On Feb 12, 3:18 pm, "klaus.kohlbauer" <klaus.kohlba...@infosense.de>
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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to