Method: MultiMail::Sender::SendGrid#initialize

Defined in:
lib/multi_mail/sendgrid/sender.rb

#initialize(options = {}) ⇒ SendGrid

Initializes a SendGrid outgoing email sender.

Parameters:

  • options (Hash) (defaults to: {})

    required and optional arguments

Options Hash (options):

  • :api_user (String)

    a SendGrid API user

  • :api_key (String)

    a SendGrid API key

  • the (Hash, String)

    X-SMTPAPI SendGrid header

See Also:



17
18
19
20
21
22
# File 'lib/multi_mail/sendgrid/sender.rb', line 17

def initialize(options = {})
  super
  if Hash === settings[:'x-smtpapi']
    settings[:'x-smtpapi'] = JSON.dump(settings[:'x-smtpapi'])
  end
end