diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-04-04 13:22:12 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-04-04 13:22:12 +0200 |
commit | c918298c8e5096b58dfcfbeb2a8a90c17ab4df3e (patch) | |
tree | eb01c88804f36c7edded9f7c7bea2ba61dbdbe26 /guides/source | |
parent | af8a788ab7f18a23d46d9b8fb5ceceef2c527045 (diff) | |
download | rails-c918298c8e5096b58dfcfbeb2a8a90c17ab4df3e.tar.gz rails-c918298c8e5096b58dfcfbeb2a8a90c17ab4df3e.tar.bz2 rails-c918298c8e5096b58dfcfbeb2a8a90c17ab4df3e.zip |
describe Action Mailer I18n subject lookup
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/i18n.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/guides/source/i18n.md b/guides/source/i18n.md index 5304ca4285..d187d3a03a 100644 --- a/guides/source/i18n.md +++ b/guides/source/i18n.md @@ -837,6 +837,28 @@ en: NOTE: In order to use this helper, you need to install [DynamicForm](https://github.com/joelmoss/dynamic_form) gem by adding this line to your Gemfile: `gem 'dynamic_form'`. +### Translations for Action Mailer E-Mail Subjects + +If you don't pass a subject to the `mail` method, Action Mailer will try to find +it in your translations. The performed lookup will use the pattern +`<mailer_scope>.<action_name>.subject` to construct the key. + +```ruby +# user_mailer.rb +class UserMailer < ActionMailer::Base + def welcome(user) + #... + end +end +``` + +```yaml +en: + user_mailer: + welcome: + subject: "Welcome to Rails Guides!" +``` + ### Overview of Other Built-In Methods that Provide I18n Support Rails uses fixed strings and other localizations, such as format strings and other format information in a couple of helpers. Here's a brief overview. |