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 !!
on 2010-02-06 17:38
on 2010-02-06 17:41
try to rename the english version to --> activation_instructions.en.html.erb 2010/2/6 Erwin <yves_dufour@mac.com> > class Notifier < ActionMailer::Base > => 1) > it should be the english one (default) > rails-i18n+unsubscribe@googlegroups.com<rails-i18n%2Bunsubscribe@googlegroups.com> > . > 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.
on 2010-02-06 18:30
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 <yves_dufour@mac.com>:
on 2010-02-06 18:33
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 Knapik <krzysztof.knapik@gmail.com>:
on 2010-02-07 09:07
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 : http://blog.andischacke.com/2009/10/localized-acti... :-))
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.