Hello, I have a big problem und hoping for your help. In my application a user should be able to edit an email template file for himself and send it out e.g. to a customer. (thats the plan). For that I have created some functionality to edit the template file and an ActionMailer class with a method called ''createMail''. The user is editing the template file, saves the file and then he is sending the mail to the customer. Thats working fine. But now the user is making changes on the template file and he wants to send it out again. And now my problem comes up. The result of createMail() is the same as it was for the first time. The changes, the user has made in the template file are not in the created email. I think that has something to do with caching. Because all is working well in the development environment but not in production. Is there anyone who can help. Is there a possibility to force the system to use the newer version of the template file and not to be ''proud'' of an old file. If I can get any help you will get an invitation to the octoberfest in munich/bavaria/germany later this year :) Best regards Klaus Kohlbauer infosense gmbh Infanteriestrasse 19/5 80797 München Telefon Büro: +49 89 12 11 35 59 Telefon Mobil: +49 173 999 777 9 Email: klaus.kohlbauer-mM0d1CyXVnioYr4blSSd5g@public.gmane.org Web: www.infosense.de --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Feb 12, 3:18 pm, "klaus.kohlbauer" <klaus.kohlba...-mM0d1CyXVnioYr4blSSd5g@public.gmane.org> wrote:> Hello, > > I have a big problem und hoping for your help. > > In my application a user should be able to edit an email template file > for himself and send it out e.g. to a customer. (thats the plan). > > For that I have created some functionality to edit the template file > and an ActionMailer class with a method called ''createMail''. The user > is editing the template file, saves the file and then he is sending > the mail to the customer. Thats working fine. But now the user is > making changes on the template file and he wants to send it out > again. And now my problem comes up. The result of createMail() is the > same as it was for the first time. The changes, the user has made in > the template file are not in the created email. > > I think that has something to do with caching. Because all is working > well in the development environment but not in production.You might be interested in http://groups.google.com/group/rubyonrails-core/browse_thread/thread/1119127159435e5c They''re talking about actioncontroller views rather than actionmailer views but it''s all the same really. What I''ve done in the past is just sidestep this completely with a mailer method like this: def standard_email(recipient, template) setup_common(recipient) @subject = template.subject @body = Liquid::Template.parse(template.body).render({}) end template is an activerecord object holding the body, subject etc. of the message. I happened to use Liquid to render the message, but that''s up to you. You could read templates from disk rather than from database. Fred --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sound good - I will try it. Thanks. Klaus Kohlbauer On 12 Feb., 17:04, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Feb 12, 3:18 pm, "klaus.kohlbauer" <klaus.kohlba...-mM0d1CyXVnioYr4blSSd5g@public.gmane.org> > wrote: > > > > > > > Hello, > > > I have a big problem und hoping for your help. > > > In my application a user should be able to edit an email template file > > for himself and send it out e.g. to a customer. (thats the plan). > > > For that I have created some functionality to edit the template file > > and an ActionMailer class with a method called ''createMail''. The user > > is editing the template file, saves the file and then he is sending > > the mail to the customer. Thats working fine. But now the user is > > making changes on the template file and he wants to send it out > > again. And now my problem comes up. The result of createMail() is the > > same as it was for the first time. The changes, the user has made in > > the template file are not in the created email. > > > I think that has something to do with caching. Because all is working > > well in the development environment but not in production. > > You might be interested inhttp://groups.google.com/group/rubyonrails-core/browse_thread/thread/... > They''re talking about actioncontroller views rather than actionmailer > views but it''s all the same really. > > What I''ve done in the past is just sidestep this completely with a > mailer method like this: > > def standard_email(recipient, template) > setup_common(recipient) > @subject = template.subject > @body = Liquid::Template.parse(template.body).render({}) > end > > template is an activerecord object holding the body, subject etc. of > the message. I happened to use Liquid to render the message, but > that''s up to you. You could read templates from disk rather than from > database. > > Fred- Zitierten Text ausblenden - > > - Zitierten Text anzeigen ---~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---