Action mailer with i18n options
Ruby
Switch branches/tags
Nothing to show
Pull request Compare This branch is 2 commits ahead, 18 commits behind mataki:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
MIT-LICENSE
README.rdoc
Rakefile
init.rb
install.rb
uninstall.rb

README.rdoc

I18nActionMailer

Forked version of: github.com/Bertg/i18n_action_mailer

Original author: bertg

This plugin will allow ActionMailer to use the I18n library without affecting the controllers language.

Rails currently saves the locale in a thread. When you want to send an email in a different language, this value is used. When the ActionMailer changes the locale, the controller will be affected.

This library lets

  • the ActionMailer save it's own locale

  • provide translation and localisation functions for the mailer

  • override the ActionView translation methods to use the ActionMailer's locale

Example

class Mailer < ActionMailer::Base

  def greet_user(user)
    set_locale  user.locale
    subject     t('mailer.greet_user.title')
    recipients  user.email
    body        :user => user
  end

end

Copyright © 2009 Bert Goethals (@bertgoethals), released under the MIT license