Class: ActionMailer::Base
- Inherits:
-
Object
- Object
- ActionMailer::Base
- Defined in:
- lib/action_mailer/ar_mailer.rb
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
19 20 21 |
# File 'lib/action_mailer/ar_mailer.rb', line 19 def self.email_class @@email_class_name.constantize end |
.email_class=(klass) ⇒ Object
15 16 17 |
# File 'lib/action_mailer/ar_mailer.rb', line 15 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.
27 28 29 30 31 32 |
# File 'lib/action_mailer/ar_mailer.rb', line 27 def perform_delivery_activerecord(mail) sender = (mail['return-path'] && mail['return-path'].spec) || mail.from.first mail.destinations.each do |destination| self.class.email_class.create :mail => mail.encoded, :to => destination, :from => sender end end |