devise icon indicating copy to clipboard operation
devise copied to clipboard

Allow providing computed method for To header

Open DaAwesomeP opened this issue 11 months ago • 1 comments

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 avatar Feb 07 '25 03:02 DaAwesomeP

@DaAwesomeP , I think I could help this one.

boypie510 avatar Jul 30 '25 07:07 boypie510