Sha256: db3c7626799623ece3b79d525480ea5647c168638abe21f1aba07e3e36754d06

Contents?: true

Size: 367 Bytes

Versions: 4

Compression:

Stored size: 367 Bytes

Contents

module Effective
  class LiquidMailer < ::ActionMailer::Base
    def mail(headers = {}, &block)
      # this be dangerous and requires ruby 2.0+
      mail_method = caller_locations(1,1)[0].label
      email_template = EffectiveEmailTemplates.get(mail_method)
      headers = headers.merge(email_template.mail_options)
      super(headers, &block)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
effective_email_templates-0.3.3 lib/effective/liquid_mailer.rb
effective_email_templates-0.3.1 lib/effective/liquid_mailer.rb
effective_email_templates-0.3.0 lib/effective/liquid_mailer.rb
effective_email_templates-0.2.8 lib/effective/liquid_mailer.rb