Very new to Rails an enjoying myself a great deal. Been playing around
with the ActionMailer today sending emails. I'm currently sending a
multipart email using the naming conventions for my views to send both
an HTML and a TEXT version of the content.
contact.text.html.erb
contact.text.plain.erb
and this is working just perfectly. What I'm now looking to do is
apply a layout to the HTML emails that are sent from the system, so
that all have a uniform look and feel.
I understand how I can apply a layout to a standard HTML view which
gets rendered in the browser but I'm struggling to figure out how this
can be done, if at all, for HTML emails.
I'd appreciate any help you can offer, if you need any more
information then please let me know.
I've now solved the issue, although still confused.
I followed your advice of adding the explicite statement but simply
got an error saying that /layouts/notifications.erb was no present.
I then removed the explicite statement and changes the name of my
layout (contradictory to the docs) from:
/layouts/notifications_mailer.text.html.erb
to
/layouts/notifications.text.html.erb
and it all sprung into life and appears to be working just fine! go
figure! :-s My only guess is that the docs is based on the assumption
that my mailer class is called NotificationsMailer and not just
Notifications?
Either way the docs confused me a little, however, with your help I'm
now up and running.