Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Devise and localized own mail template

Tags:

I'm using devise gem and want to translate confirmation mail. I already got my own template and overridden mailer method:

class LocalizedDeviseMailer < Devise::Mailer
  def confirmation_instructions(record, locale)
    @locale = locale
    super
  end
end

So, in my template I can do something like that:

I18n.locale = @locale

And then:

t("it.really.works")

But I don't know how to pass my variable with locale to mailer method. What is the best way to do that? Any help would be appreciated.