Method: MultiMail::Message::SendGrid#sendgrid_headers

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

#sendgrid_headersHash

Returns the message headers in SendGrid format.

Returns:

  • (Hash)

    the message headers in SendGrid format



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/multi_mail/sendgrid/message.rb', line 8

def sendgrid_headers
  hash = {}
  header_fields.each do |field|
    key = field.name.downcase
    unless %w(to subject from bcc reply-to date).include?(key)
      # The JSON must not contain integers.
      hash[field.name] = field.value.to_s
    end
  end
  hash
end