Sha256: ecf7325f9a286723ff15dc25fdbf7e74458efde076f9efbc68ca19d21fa5cbc7

Contents?: true

Size: 344 Bytes

Versions: 2

Compression:

Stored size: 344 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)
      mail.header['X-SMTPAPI'] = sendgrid_header.to_json if sendgrid_header.data.present?
      mail.header['to'] = 'dummy@email.com'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sendgrid-rails-2.0.2 lib/send_grid/mail_interceptor.rb
sendgrid-rails-2.0.1 lib/send_grid/mail_interceptor.rb