Sha256: 6ff9692172c6c1379fd99bfac8668506121a3d0c8571b623595984e75fbf4f71
Contents?: true
Size: 1.09 KB
Versions: 1
Compression:
Stored size: 1.09 KB
Contents
## # Adds sending email through an ActiveRecord table as a delivery method for # ActionMailer. # class ActionMailer::Base ## # Set the email class for deliveries. Handle class reloading issues which prevents caching the email class. # @@email_class_name = 'Email' def self.email_class=(klass) @@email_class_name = klass.to_s end def self.email_class @@email_class_name.constantize end ## # Set the email class for successful deliveries. # @@email_backup_class_name = 'EmailBackup' def self.email_backup_class=(klass) @@email_backup_class_name = klass.to_s end def self.email_backup_class @@email_backup_class_name.constantize end ## # Adds +mail+ to the Email table. Only the first From address for +mail+ is # used. def perform_delivery_activerecord(mail) destinations = mail.destinations mail.ready_to_send sender = (mail['return-path'] && mail['return-path'].spec) || mail.from.first destinations.each do |destination| self.class.email_class.create :mail => mail.encoded, :to => destination, :from => sender end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
fishman-ar_mailer-2.1.9 | lib/action_mailer/ar_mailer.rb |