Skip to content

Commit

Permalink
reverse merge strategy to favor admin's choices
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Feaver committed Dec 4, 2014
1 parent e0e2103 commit c328df4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ rake db:migrate
- Create a mailer method for each email
- Mailer objects need to inherit from `Effective::LiquidMailer`
- Mailer methods and email template slugs need to match up
- Email headers will be automatically used from your model but may be overwritten in the mail method (from, subject, cc, and bcc)
- Email headers can be declared in the #mail method but can be overrided by the saved attributes on the Effective::EmailTemplate model.

```ruby
# app/mailers/user_liquid_mailer.rb
Expand Down
2 changes: 1 addition & 1 deletion lib/effective/liquid_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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 = email_template.mail_options.merge(headers)
headers = headers.merge(email_template.mail_options)
super(headers, &block)
end
end
Expand Down

0 comments on commit c328df4

Please sign in to comment.