Class: Resque::SMTP::DeliveryMethod
- Inherits:
-
Object
- Object
- Resque::SMTP::DeliveryMethod
- Defined in:
- lib/resque/smtp/delivery_method.rb
Overview
Enqueues emails in Resque.
Just set action_mailer delivery method to :resque_smtp and all emails will be enqueued.
Delivery settings are not used as they are extracted from RCore.config at the moment emails are really delivered.
If you want to have dedicated settings for this method you can set config.action_mailer.smtp_resque_settings in the application config.
Instance Attribute Summary collapse
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Instance Method Summary collapse
- #deliver!(mail) ⇒ Object
-
#initialize(settings) ⇒ DeliveryMethod
constructor
A new instance of DeliveryMethod.
Constructor Details
#initialize(settings) ⇒ DeliveryMethod
Returns a new instance of DeliveryMethod.
21 22 23 24 |
# File 'lib/resque/smtp/delivery_method.rb', line 21 def initialize(settings) @settings = settings EmailJob.queue = settings[:queue] if settings[:queue] end |
Instance Attribute Details
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
19 20 21 |
# File 'lib/resque/smtp/delivery_method.rb', line 19 def settings @settings end |
Instance Method Details
#deliver!(mail) ⇒ Object
26 27 28 29 |
# File 'lib/resque/smtp/delivery_method.rb', line 26 def deliver!(mail) # Enqueue email dumped as string Resque.enqueue(EmailJob, mail.encoded) end |