Welcome to Working With Rails


Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
Multilingual Email Within UserObserver?
2 Posts
Multilingual Email Within UserObserver?


I have a beta testing program for a multilingual webapp using globalite. People register on the website in english or in french.

I use a UserObserver from acts_as_authenticated plugin that send an email with an activation code to validate registration. Depending on which language... I need to send the good email.

Using the after_create within UserObserver, is there a way to pass the language variable in the model or do I need to setup this in the controller?

Or is there any other way to achieve this beside sending a multilingual email hehe.

Thx a lot for your time and advises.


I know that acts_as_authenticated sets up the email as an observer for you, but I'd recommend in favor of removing the observer and sending the email directly from the controller when the user is created. Using observers to send emails obscures code, and brings up the sort of logic issues you are dealing with.

2 Posts
Login to add your message