Last active
March 21, 2017 07:48
-
-
Save lalitlogical/fda5148411402efe35bd79917fcdb079 to your computer and use it in GitHub Desktop.
Dynamic subject for Devise mailers (i.e. reset_password_instructions)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomDeviseMailer < Devise::Mailer | |
helper :application # gives access to all helpers defined within `application_helper`. | |
include Devise::Controllers::UrlHelpers # Optional. eg. `confirmation_url` | |
default template_path: 'devise/mailer' # to make sure that your mailer uses the devise views | |
def reset_password_instructions(record, token, opts={}) | |
opts[:subject] = I18n.t(:'devise.mailer.reset_password_instructions.subject', app_name: ENV['APP_NAME']) | |
super | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
en: | |
devise: | |
....... | |
....... | |
mailer: | |
confirmation_instructions: | |
subject: "Confirmation instructions" | |
reset_password_instructions: | |
subject: "Reset your %{app_name} Password" | |
unlock_instructions: | |
subject: "Unlock instructions" | |
password_change: | |
subject: "Your %{app_name} Password Changed" | |
....... | |
....... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment