Class: ActionMailer::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/am-sendgrid.rb

Instance Method Summary collapse

Instance Method Details

#create_mail_with_sendgrid_headerObject



11
12
13
14
# File 'lib/am-sendgrid.rb', line 11

def create_mail_with_sendgrid_header
  headers["X-SMTPAPI"] = sendgrid_header.asJSON if sendgrid_header
  create_mail_without_sendgrid_header
end

#sendgrid_category(category) ⇒ Object



22
23
24
# File 'lib/am-sendgrid.rb', line 22

def sendgrid_category(category)
  sendgrid_header.setCategory category
end

#sendgrid_filter_setting(*args) ⇒ Object



18
19
20
# File 'lib/am-sendgrid.rb', line 18

def sendgrid_filter_setting(*args)
  sendgrid_header.addFilterSetting *args
end

#sendgrid_headerObject



7
8
9
# File 'lib/am-sendgrid.rb', line 7

def sendgrid_header
  @sendgrid_header ||= SmtpApiHeader.new
end