Class: Spree::Core::MailInterceptor

Inherits:
Object
  • Object
show all
Defined in:
lib/spree/core/mail_interceptor.rb

Class Method Summary collapse

Class Method Details

.delivering_email(message) ⇒ Object


8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/spree/core/mail_interceptor.rb', line 8

def self.delivering_email(message)
  return unless MailSettings.override?

  if Config[:intercept_email].present?
    message.subject = "#{message.to} #{message.subject}"
    message.to = Config[:intercept_email]
  end

  if Config[:mail_bcc].present?
    message.bcc ||= Config[:mail_bcc]
  end
end