Module: SendGrid::InstanceMethods

Defined in:
lib/send_grid.rb

Instance Method Summary collapse

Instance Method Details

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


21
22
23
24
25
# File 'lib/send_grid.rb', line 21

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

#open_tracking(enabled = true) ⇒ Object


27
28
29
# File 'lib/send_grid.rb', line 27

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

#send_grid_headerObject


17
18
19
# File 'lib/send_grid.rb', line 17

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