Skip to content

Commit

Permalink
describe Action Mailer I18n subject lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
senny committed Apr 4, 2013
1 parent af8a788 commit c918298
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions guides/source/i18n.md
Expand Up @@ -837,6 +837,28 @@ en:
NOTE: In order to use this helper, you need to install [DynamicForm](https://github.com/joelmoss/dynamic_form) 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'`. 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 ### 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. 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.
Expand Down

0 comments on commit c918298

Please sign in to comment.