Forum: Ruby on Rails Graceful degradation/progressive enhancement for ActionMailer templates?

Posted by Jay Levitt (jay-levitt)
on 2011-11-29 16:17
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.
Posted by Frederick Cheung (Guest)
on 2011-11-29 18:00
(Received via mailing list)
On Nov 29, 3:17pm, Jay Levitt <li...@ruby-forum.com> wrote:
> 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
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.