Module: SendGridSmtpApi::InstanceMethods

Defined in:
lib/send_grid.rb

Instance Method Summary collapse

Instance Method Details

#mail(headers = {}, &block) ⇒ Object



19
20
21
22
23
# File 'lib/send_grid.rb', line 19

def mail(headers={}, &block)
  super.tap do |message|
    message.instance_variable_set :@sendgrid_header, sendgrid_header
  end
end

#open_tracking(enabled = true) ⇒ Object



25
26
27
# File 'lib/send_grid.rb', line 25

def open_tracking(enabled = true)
  add_filter_setting(:opentrack, :enable, enabled ? 1 : 0) unless enabled.nil?
end

#send_grid_headerObject



15
16
17
# File 'lib/send_grid.rb', line 15

def send_grid_header
  @send_grid_header ||= SendGridSmtpApi::ApiHeader.new
end