Is there some gem or technique that will let us write only .html.erb
templates for our Rails 3 mailers, and gracefully degrade them by
stripping HTML tags for the text/plain version, rather than having to
create each partial twice?
Google is seriously failing me, so I must be searching for the wrong
terms; it’s hard to believe nobody’s ever even asked about this before.
Is there some gem or technique that will let us write only .html.erb
templates for our Rails 3 mailers, and gracefully degrade them by
stripping HTML tags for the text/plain version, rather than having to
create each partial twice?
Google is seriously failing me, so I must be searching for the wrong
terms; it’s hard to believe nobody’s ever even asked about this before.
Something i’ve tried in the past is write the email templates in
markdown (i.e. a template language which is designed to be easily
readable in plain text). html readers get the processed version of the
email, plain text readers get the raw markdown.
Fred
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.