Class: ActionMailer::Base
- Inherits:
-
Object
- Object
- ActionMailer::Base
- Defined in:
- lib/action_mailer/ar_mailer.rb
Direct Known Subclasses
Constant Summary collapse
- @@email_class_name =
Set the email class for deliveries. Handle class reloading issues which prevents caching the email class.
'Email'
Class Method Summary collapse
Instance Method Summary collapse
-
#perform_delivery_activerecord(mail) ⇒ Object
Adds
mail
to the Email table.
Class Method Details
.email_class ⇒ Object
27 28 29 |
# File 'lib/action_mailer/ar_mailer.rb', line 27 def self.email_class @@email_class_name.constantize end |
.email_class=(klass) ⇒ Object
23 24 25 |
# File 'lib/action_mailer/ar_mailer.rb', line 23 def self.email_class=(klass) @@email_class_name = klass.to_s end |
Instance Method Details
#perform_delivery_activerecord(mail) ⇒ Object
Adds mail
to the Email table. Only the first From address for mail
is used.
35 36 37 38 39 |
# File 'lib/action_mailer/ar_mailer.rb', line 35 def perform_delivery_activerecord(mail) mail.destinations.each do |destination| self.class.email_class.create :mail => mail.encoded, :to => destination, :from => mail.from.first end end |