Does anyone have any experience with creating a templating system for e-mails sent via Rails? Here is what I''d like to do: 1. User selects "Create message" from my application 2. User selects a predefined template from dropdown list. 3. Selected template populates the message field with the template tags replaced with correct values (replacing <%= @tutor.name %> with John Doe for example) The issue I am running into is I am not sure if I can use standard RHTML or ERB templates to define the Mail templates. If I can, I am not sure how to replace the <% %> fields with the correct values on the fly. If anyone has any experience with a solution like this, I am all ears. Thanks. - j --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 3/5/07, Justin Williams <carpeaqua-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Does anyone have any experience with creating a templating system for > e-mails sent via Rails? Here is what I''d like to do: > > 1. User selects "Create message" from my application > 2. User selects a predefined template from dropdown list. > 3. Selected template populates the message field with the template > tags replaced with correct values (replacing <%= @tutor.name %> with > John Doe for example) > > The issue I am running into is I am not sure if I can use standard > RHTML or ERB templates to define the Mail templates. If I can, I am > not sure how to replace the <% %> fields with the correct values on > the fly. > > If anyone has any experience with a solution like this, I am all ears.I believe shopify uses Liquid templates for this. If it doesn''t, Liquid would still be a good fit. Executing pure ruby (erb) from something a user entered is usually not a good thing. -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.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 Rick. I will look into it. - j On Mar 5, 2:29 pm, "Rick Olson" <technowee...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 3/5/07, Justin Williams <carpea...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > Does anyone have any experience with creating a templating system for > > e-mails sent via Rails? Here is what I''d like to do: > > > 1. User selects "Create message" from my application > > 2. User selects a predefined template from dropdown list. > > 3. Selected template populates the message field with the template > > tags replaced with correct values (replacing <%= @tutor.name %> with > > John Doe for example) > > > The issue I am running into is I am not sure if I can use standard > > RHTML or ERB templates to define the Mail templates. If I can, I am > > not sure how to replace the <% %> fields with the correct values on > > the fly. > > > If anyone has any experience with a solution like this, I am all ears. > > I believe shopify uses Liquid templates for this. If it doesn''t, > Liquid would still be a good fit. Executing pure ruby (erb) from > something a user entered is usually not a good thing. > > -- > Rick Olsonhttp://weblog.techno-weenie.nethttp://mephistoblog.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 -~----------~----~----~----~------~----~------~--~---