rubyonrailsin

A Ruby and Rails talk

Friday, March 26, 2010


Re: [Rails] Multilingual Email Within UserObserver?

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

Hugues,

Robby Russell has a pretty good blog post 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 Brunelle <lists@ruby-forum.com>
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
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive