# Multilingual Email Within UserObserver?

**URL:** <https://www.ruby-forum.com/t/multilingual-email-within-userobserver/185680>\
**Category:** Rails\
**Created:** [March 24, 2010, 4:29pm UTC](https://www.ruby-forum.com/t/multilingual-email-within-userobserver/185680 "2010-03-24T16:29:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hugues](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/f04885/32.png) [@hugues](https://www.ruby-forum.com/u/hugues)\
**Post date:** [March 24, 2010, 4:29pm UTC](https://www.ruby-forum.com/t/multilingual-email-within-userobserver/185680/1 "2010-03-24T16:29:56Z")

</div>

Hello,

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.

Hugues

---

<div class="post-metadata">

**Author:** ![hugues](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/f04885/32.png) [@hugues](https://www.ruby-forum.com/u/hugues)\
**Post date:** [March 26, 2010, 6:47pm UTC](https://www.ruby-forum.com/t/multilingual-email-within-userobserver/185680/2 "2010-03-26T18:47:15Z")

</div>

Hugues,

Robby R. has a pretty good blog  
post[http://www.robbyonrails.com/articles/2009/11/16/sending-email-controllers-versus-models](http://www.robbyonrails.com/articles/2009/11/16/sending-email-controllers-versus-models)about  
this subject â€“ sending email from controllers vs. models. Please read  
the comments as well as there’s a lot of helpful discussion going on  
there.  
I think I’m going with sending emails from the controller, which in your  
case would make it easier to send email in different languages. However,  
if  
you prefer to send the email from your observer, a solution could be to  
store the user’s language in the user model.

Hope this helps.

/Lasse

2010/3/24 Hugues B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![hugues](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/f04885/32.png) [@hugues](https://www.ruby-forum.com/u/hugues)\
**Post date:** [March 26, 2010, 8:06pm UTC](https://www.ruby-forum.com/t/multilingual-email-within-userobserver/185680/3 "2010-03-26T20:06:44Z")

</div>

Hi Lasse,  
Thank you. It might help.  
Hugues
