Forum: Rails I18n Issue with mail notification

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
465a674b0471ff8c76ae7597c94b075d?d=identicon&s=25 Kad K. (kadoudal)
on 2010-02-06 17:38
(Received via mailing list)
Rails 2.3.5 / Ruby 1.8.7

Hi All

I have a small issue when using mail notification

my default locale is :en (but I have already 2 locales  :en , :fr  for
testing purpose

I have a Notifier model ..
class Notifier < ActionMailer::Base
  def activation_instructions(user)
    subject       I18n.t("mail.subject.activation_instructions")
    from          Setting.mail_from
    body          :account_activation_url =>
    body          :account_type => I18n.t("label.#{user.type}", :count
=> 1)

all labels comes in English , that's fine....
I have 2 views ...

and I always get the french version  email (with the english labels in
it...)  ......
it should be the english one (default)
what's wrong....  ?

thanks for your enlightments !!
F3f9c2dee45279a8220cdad901be6f06?d=identicon&s=25 Andrés G. (andresgutgon)
on 2010-02-06 17:41
(Received via mailing list)
try to rename the english version to -->

2010/2/6 Erwin <>

> class Notifier < ActionMailer::Base
> => 1)
> it should be the english one (default)
> .
> For more options, visit this group at

Experiencia es lo que obtienes, cuando no obtienes lo que quieres.
Krzysztof Knapik (Guest)
on 2010-02-06 18:30
(Received via mailing list)
ActionMailer by default supports full content-type extensions e.g:
text.plain.erb, text.html.erb, so you should follow this convention,
otherwise your fr.html is taken as content type ("fr/html").

And your templates should be named:



2010/2/6 Erwin <>:
Krzysztof Knapik (Guest)
on 2010-02-06 18:33
(Received via mailing list)


if plain text message in enough for you. If you have both plain and
html, ActionMailer builds multipart/alternative email.


2010/2/6 Krzysztof Knapik <>:
465a674b0471ff8c76ae7597c94b075d?d=identicon&s=25 Kad K. (kadoudal)
on 2010-02-07 09:07
(Received via mailing list)
It seems not to be working...
no problem when I get rid of the locale extension...
activation_instructions.text.html.erb   works   doesn't work

but I discover this info :

This topic is locked and can not be replied to.