I’m sending an email using an ActionMailer class in Rails 2.3.8. I need to add a META tag to the HEAD of the email. Specifically, I want to add this (ultimately for handling special CSS3 on mobile devices):
<meta name="viewport" content="width=device-width" />
I can’t find a way to add this to the HEAD section of the email. Do I need to create a custom email layout that I use? If so, how do I do that? It seems like there should be an easier way than creating a custom layout.
It sounds like you want to send a HTML email and set the
metatag in the view. Try updating your ActionMailer content-type with something like:Then add the following line to your view’s layout or
<head>section: