Class: Mailflow::Rails::ActionMailerDeliveryMethod
- Inherits:
-
Object
- Object
- Mailflow::Rails::ActionMailerDeliveryMethod
- Defined in:
- lib/mailflow/rails/action_mailer_delivery_method.rb
Instance Attribute Summary collapse
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Instance Method Summary collapse
- #deliver!(message) ⇒ Object
-
#initialize(settings) ⇒ ActionMailerDeliveryMethod
constructor
A new instance of ActionMailerDeliveryMethod.
Constructor Details
#initialize(settings) ⇒ ActionMailerDeliveryMethod
Returns a new instance of ActionMailerDeliveryMethod.
6 7 8 |
# File 'lib/mailflow/rails/action_mailer_delivery_method.rb', line 6 def initialize(settings) @settings = settings end |
Instance Attribute Details
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
4 5 6 |
# File 'lib/mailflow/rails/action_mailer_delivery_method.rb', line 4 def settings @settings end |
Instance Method Details
#deliver!(message) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/mailflow/rails/action_mailer_delivery_method.rb', line 10 def deliver!() client. do |m| m.mail_from(.from.first) add_recipients(m, ) m.data(.to_s) end rescue StandardError => e # Consider logging the error or re-raising a custom error with a clearer message. raise "Failed to deliver message: #{e.}" end |