Sha256: 48441c0f999634148e881db9325dad39d67e15629a83802fc35ef213f64948bf

Contents?: true

Size: 462 Bytes

Versions: 2

Compression:

Stored size: 462 Bytes

Contents

module MailSafe
  module ActionMailer
    def self.included(base)
      base.class_eval do
        alias_method_chain :deliver!, :mail_safe
      end
    end

    def deliver_with_mail_safe!(mail = @mail)
      MailSafe::AddressReplacer.replace_external_addresses(mail) if mail
      deliver_without_mail_safe!(mail)
    end
  end
end

ActionMailer::Base.send(:include, MailSafe::ActionMailer) unless ActionMailer::Base.ancestors.include?(MailSafe::ActionMailer)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mail_safe-0.3.1 lib/mail_safe/rails2_hook.rb
mail_safe-0.3.0 lib/mail_safe/rails2_hook.rb