Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (27 sloc) 1.71 KB

easy_i18n_emails

I18nEmails makes it easy to create and maintain I18n emails in Rails apps.

Using I18n in large Rails apps often results in large and incomprehensible translation files. The idea of splitting up concerns should also apply to translations files and emails in particular and that is why this gem was created.

I18nEmails allows you to create separate translation files for each email (.email) and store them in a nested folder structure mirroring a translation file, for example: config/locales/en/notifier/forgotten_password.email.

The email body content in a .email file is also more readable for both developer and non-technical people then a YAML file.

Example email:

subject: Forgotten password

heading: It's ok, we all forget our passwords sometimes
# Available interpolation args: username, link

--------------------------------------------

Hi %{username},

Click here to reset your password %{link}.

Have a great day!

Notes

Anything above the ---- is still parsed as YAML, but anything below it becomes the body of the email (newlines are converted to <p></p> tags using simple_format)

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don't break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Contributors

Copyright

Copyright © 2010 Matt Vague, VersaPay Corporation. See LICENSE for details.