Sometimes you may want to change the subject of a devise email. This also works with devise_invitable. Its pretty simple.
First tell devise we want to use a custom controller:
# config/initializers/devise.rb
config.mailer = "CustomDeviseMailer"
Then create the custom devise mailer. In this example I am overriding the devise_invitable invitation_instructions
email:
# app/mailers/custom_devise_mailer.rb:
class CustomDeviseMailer < Devise::Mailer
protected
def subject_for(key)
if key.to_s == 'invitation_instructions'
"You have been invited to Super Awesome App"
else
return super
end
end
end
Related External Links: