Class: SendGridSmtpApi::MailInterceptor
- Inherits:
-
Object
- Object
- SendGridSmtpApi::MailInterceptor
- Defined in:
- lib/send_grid/mail_interceptor.rb
Class Method Summary collapse
Class Method Details
.delivering_email(mail) ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/send_grid/mail_interceptor.rb', line 3 def self.delivering_email(mail) sendgrid_header = mail.instance_variable_get(:@sendgrid_header) standard_smtp = sendgrid_header.instance_variable_get(:@standard_smtp) unless standard_smtp sendgrid_header.add_recipients(mail.to) mail.header['to'] = '[email protected]' end mail.header['X-SMTPAPI'] = sendgrid_header.to_json if sendgrid_header.data.present? end |