cookieshq / hebillas

New version of our Rails template, working on top of Suspenders
20 stars 2 forks source link

Mailer layout proc should be in application.rb #2

Open rjpaskin opened 8 years ago

rjpaskin commented 8 years ago

The following fragment should be moved from config/environments/development.rb to config/application.rb - so that's it used in all environments - and not just development:

# Use email template for emails except on devise mails sent for admin users
config.to_prepare do
  ActionMailer::Base.layout proc { |mailer|
    if mailer.is_a?(Devise::Mailer) && mailer.scope_name == :admin_user
      nil
    else
      "email"
    end
  }
end
nicalpi commented 8 years ago

👍 Happy to review a PR