devise
devise copied to clipboard
Allow providing computed method for To header
Hello,
I am trying to do the following so that the mail header To field contains a user's name as well as email address.
class ApplicationDeviseMailer < Devise::Mailer
default to: -> { computed_to }
private
def computed_to
ApplicationMailer.email_address_with_name(resource.email, resource.name)
end
end
However, there is not an option to transform the To field (only From and Reply-To):
https://github.com/heartcombo/devise/blob/fec67f98f26fcd9a79072e4581b1bd40d0c7fa1d/lib/devise/mailers/helpers.rb#L31-L48
@DaAwesomeP , I think I could help this one.