Sha256: ba6d53a5ba3c795a4422995a4f261f0812b59de2b945b5a84c08b62638614dde

Contents?: true

Size: 451 Bytes

Versions: 4

Compression:

Stored size: 451 Bytes

Contents

module SendGrid
  class MailInterceptor
    def self.delivering_email(mail)
      sendgrid_header = mail.instance_variable_get(:@sendgrid_header)
      sendgrid_header.add_recipients(mail.to)
      sendgrid_header.add_recipients(mail.cc)
      sendgrid_header.add_recipients(mail.bcc)
      mail.header['X-SMTPAPI'] = sendgrid_header.to_json if sendgrid_header.data.present?
      mail.header['to'] = SendGrid.config.dummy_recipient
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sendgrid-rails-3.1.0 lib/send_grid/mail_interceptor.rb
sendgrid-rails-3.0.0 lib/send_grid/mail_interceptor.rb
sendgrid-rails-2.0.5 lib/send_grid/mail_interceptor.rb
sendgrid-rails-2.0.4 lib/send_grid/mail_interceptor.rb