Issue with mail notification

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)
debugger
subject I18n.t(“mail.subject.activation_instructions”)
from Setting.mail_from
recipients user.email
sent_on Time.now
body :account_activation_url =>
register_url(user.perishable_token)
body :account_type => I18n.t(“label.#{user.type}”, :count
=> 1)
end

all labels comes in English , that’s fine…
BUT
I have 2 views …
activation_instructions.html.erb
activation_instructions.fr.html.erb

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 !!

try to rename the english version to →
activation_instructions.en.html.erb

2010/2/6 Erwin [email protected]

class Notifier < ActionMailer::Base
=> 1)
it should be the english one (default)
[email protected][email protected]
.
For more options, visit this group at
http://groups.google.com/group/rails-i18n?hl=en.


Experiencia es lo que obtienes, cuando no obtienes lo que quieres.

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:

activation_instructions.text.html.erb
activation_instructions.fr.text.html.erb

Regards,
KK

2010/2/6 Erwin [email protected]:

and…

activation_instructions.text.plain.erb
activation_instructions.fr.text.plain.erb

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

KK

2010/2/6 Krzysztof K. [email protected]:

It seems not to be working…
no problem when I get rid of the locale extension…
activation_instructions.text.html.erb works
activation_instructions.fr.text.html.erb doesn’t work

but I discover this info :

:-))