How can I send mails in a mailer using the recipient\'s locale. I have the preferred locale for each user in the database. Notice this is different from the current locale (I18n
This simple plugin was developed for rails 2 but seems to work in rails 3 too.
http://github.com/Bertg/i18n_action_mailer
With it you can do the following:
def new_follower(user, follower)
@follower = follower
@user = user
set_locale user.locale
mail :to => @user.email, :subject => t(:new_follower_subject)
end
The subject and mail templates are then translated using the user's locale.