Add a bcc to all devise generated emails ? and modify "from" email depending on the locale ?

324 views
Skip to first unread message

Alexandre Ponsin

unread,
Feb 24, 2011, 2:39:51 PM2/24/11
to Devise
Hi,

Is there a simple way to perform those 2 tasks (i.e: without
overriding the devise mailer ?)

I simply want to add a particular email in BCC of all emails generated
by Devise.

And also ideally I would like to modify the from email depending on
the locale used by the use ?

Thanks,

Alex

Alexandre Ponsin

unread,
Feb 24, 2011, 2:39:58 PM2/24/11
to Devise

Rodrigo Dellacqua

unread,
Feb 24, 2011, 11:44:06 PM2/24/11
to plataforma...@googlegroups.com, Alexandre Ponsin
You can always sub class, call super and do your stuff.

[]'s
Rodrigo Dellacqua

Karl Baum

unread,
Feb 25, 2011, 6:58:58 AM2/25/11
to plataforma...@googlegroups.com, Alexandre Ponsin
That's what i ended up doing.

Re why change it?  I've had experiences in the past where people create users and as a result emails went out.  Wouldn't want to make a mistake and send emails to my entire user base.  I know there are other ways of preventing this, but like i said, i am a bit paranoid about this.

José Valim

unread,
Feb 25, 2011, 10:06:00 AM2/25/11
to Devise
You can define headers_for in your model and it will be called passing
the name of the e-mail to be delivered:

https://github.com/plataformatec/devise/blob/master/app/mailers/devise/mailer.rb#L42-44

On Feb 25, 12:58 pm, Karl Baum <karl.b...@gmail.com> wrote:
> That's what i ended up doing.
>
> Re why change it?  I've had experiences in the past where people create users and as a result emails went out.  Wouldn't want to make a mistake and send emails to my entire user base.  I know there are other ways of preventing this, but like i said, i am a bit paranoid about this.
>
> On Feb 24, 2011, at 11:44 PM, Rodrigo Dellacqua wrote:
>
>
>
> > You can always sub class, call super and do your stuff.
>
> > []'s
> > Rodrigo Dellacqua
>

Alexandre Ponsin

unread,
Mar 3, 2011, 4:51:18 AM3/3/11
to Devise
That's perfect ! Thanks for your help.

Alex

On Feb 25, 11:06 pm, José Valim <jose.va...@gmail.com> wrote:
> You can define headers_for in your model and it will be called passing
> the name of the e-mail to be delivered:
>
> https://github.com/plataformatec/devise/blob/master/app/mailers/devis...
Reply all
Reply to author
Forward
0 new messages