Jay Levitt
2011-Nov-29 15:17 UTC
Graceful degradation/progressive enhancement for ActionMailer templates?
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 via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2011-Nov-29 16:59 UTC
Re: Graceful degradation/progressive enhancement for ActionMailer templates?
On Nov 29, 3:17 pm, Jay Levitt <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> 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 -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.