Class: ActionMailer::LoggedSMTPDelivery
- Inherits:
-
Mail::SMTP
- Object
- Mail::SMTP
- ActionMailer::LoggedSMTPDelivery
- Defined in:
- lib/action_mailer/logged_smtp_delivery.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
- #deliver!(mail) ⇒ Object
-
#initialize(settings) ⇒ LoggedSMTPDelivery
constructor
A new instance of LoggedSMTPDelivery.
Constructor Details
#initialize(settings) ⇒ LoggedSMTPDelivery
Returns a new instance of LoggedSMTPDelivery.
7 8 9 10 11 12 13 |
# File 'lib/action_mailer/logged_smtp_delivery.rb', line 7 def initialize(settings) super self.settings[:tls] = (settings[:tls] != false) self.settings[:return_response] = true self.logger = settings[:logger] self.response = nil end |
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
5 6 7 |
# File 'lib/action_mailer/logged_smtp_delivery.rb', line 5 def response @response end |
Instance Method Details
#deliver!(mail) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/action_mailer/logged_smtp_delivery.rb', line 15 def deliver!(mail) if file_logger = settings[:mail_file_logger] path = file_logger.log(mail.encoded) log mail, "stored at #{path}" end log_headers(mail) log mail, "sender: #{mail.sender}" log mail, "destinations: #{mail.destinations.inspect}" begin self.response = super log mail, "done #{response.inspect}" rescue => e logger.error("#{mail.} exception #{e.inspect}") raise end end |