Class: ARMailer
- Inherits:
-
Object
- Object
- ARMailer
- Defined in:
- lib/action_mailer/ar_mailer.rb
Overview
Adds sending email through an ActiveRecord table as a delivery method for ActionMailer.
Instance Attribute Summary collapse
-
#email_class ⇒ Object
Returns the value of attribute email_class.
-
#email_class_name ⇒ Object
Returns the value of attribute email_class_name.
Instance Method Summary collapse
- #deliver!(mail) ⇒ Object
-
#initialize(options) ⇒ ARMailer
constructor
A new instance of ARMailer.
Constructor Details
#initialize(options) ⇒ ARMailer
Returns a new instance of ARMailer.
8 9 10 |
# File 'lib/action_mailer/ar_mailer.rb', line 8 def initialize() self.email_class = [:email_class] || Email end |
Instance Attribute Details
#email_class ⇒ Object
Returns the value of attribute email_class.
12 13 14 |
# File 'lib/action_mailer/ar_mailer.rb', line 12 def email_class @email_class end |
#email_class_name ⇒ Object
Returns the value of attribute email_class_name.
12 13 14 |
# File 'lib/action_mailer/ar_mailer.rb', line 12 def email_class_name @email_class_name end |
Instance Method Details
#deliver!(mail) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/action_mailer/ar_mailer.rb', line 14 def deliver!(mail) destinations = mail.destinations sender = mail.return_path || mail.sender || mail.from_addrs.first destinations.each do |destination| self.email_class.create :mail => mail.encoded, :to => destination, :from => sender end end |