Hi everyone I want to tell my ActionMailer to use a different template depending on some custom logic. How do I tell ActionMailer to use a different template. I have tried using class_name and used explicit render function calls but I cannot get it to work. Does anybody have any tips? I should say I am using Rails 1.2.6 as I understand the ActionMailer has changed a bit in 2.0. Kindest regards Erik Lindblad --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, take a look at how Rails deals with multipart messages, specifically the render_message method: http://api.rubyonrails.com/classes/ActionMailer/Base.html - maybe this does what you want. If you need more inspiration, take a look at the Globalize localization plugin; they have modified ActionMailer to allow for per-locale email templates. Cheers Jan -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks. I will check it out. /Erik On 25 Apr, 11:22, Jan Foeh <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, > > take a look at how Rails deals with multipart messages, specifically the > render_message method:http://api.rubyonrails.com/classes/ActionMailer/Base.html- maybe this > does what you want. > > If you need more inspiration, take a look at the Globalize localization > plugin; they have modified ActionMailer to allow for per-locale email > templates. > > Cheers > Jan > -- > Posted viahttp://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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---