2
votes

I'm using rails 3.1 with Devise. When an account confirmation email goes out, it is received with the following subject line:

Subject:    [["[email protected]"]]MySite Account Confirmation Instructions

I've modified the corresponding entry in config/locals/devise.en.yml like this:

mailer:
  confirmation_instructions:
    subject: 'MySite Account Confirmation Instructions'

I don't want the '[["[email protected]"]] in the email subject line. How can I get Devise to not put it there? BTW I really don't want to have to create some custom mailer that overrides Devises' stock mailer... Big extra bonus points for an answer that avoids anything to do with custom mailers. But if that is the only way, I need to know that too...

3

3 Answers

1
votes

My guess is that the [["[email protected]"]] should actually only show up in development mode, since that's the format of ActionMailer's DevelopmentMailInterceptor (see the notes in RailsCast 206)

The email address between brackets indicates the address to which the email would have been sent on production. It instead sends it to you at an email specified in your DevelopmentMailInterceptor.

0
votes

The mail subject is generated in Devise::Mailers::Helpers.headers_for (source code here), so the most straightforward way would be monkey-patching this method.

0
votes

This was a strange one... Had to reboot my Mac, after which the problem was gone.