Sha256: 4b197f8df7a55809048f1666844b291e06e8b15cf3a39af6a748319d2fd68178
Contents?: true
Size: 748 Bytes
Versions: 37
Compression:
Stored size: 748 Bytes
Contents
# Allows us to intercept any outbound mail message and make last minute changes (such as specifying a "from" address or # sending to a test email account.) # # See http://railscasts.com/episodes/206-action-mailer-in-rails-3 for more details. module Spree class MailInterceptor def self.delivering_email(message) return unless mail_method = MailMethod.current message.from ||= mail_method.preferred_mails_from if mail_method.preferred_intercept_email.present? message.subject = "[#{message.to}] #{message.subject}" message.to = mail_method.preferred_intercept_email end if mail_method.preferred_mail_bcc.present? message.bcc = mail_method.preferred_mail_bcc end end end end
Version data entries
37 entries across 37 versions & 6 rubygems