I have this code:
class Mailer < ActionMailer::Base
def foo
recipients "[email protected]"
from "[email protected]"
subject "Foo"
body :var => "value"
end
end
With two views in app/views/mailer
:
foo.en.erb
foo.fr.erb
When I use Mailer.deliver_foo
, the view used to build the email is foo.en.erb
since I18n.locale
is set to :en
. Is there a way to bypass that and use foo.fr.erb
, other than temporarly setting the locale to :fr
, sending the email and then reverting back to :en
.
Thank you!