code-gijoe
code-gijoe

Reputation: 7234

Do I need or want the Mail gem in rails 3.0?

I'm confused.

I've been creating some emails for my application client's. So I used ActionMailer to send emails. I created a notifier with attached views to hold each one of my emails templates.

But then, my system sent some emails and they were really odd looking. So I got to the conclusion that there has to be something wrong about them. I started reading around and found interesting inputs.

I found premailer gem or roadie gem to help me embed resources (like css) into my email to make good quality html emails. But I was not yet convinced that it would be enough.

I got into the confusing part. I found the mail gem. Can this gem help me or is it just an alternative to ActionMailer? It says it will create standardized email (RFC2822), and much more, but being new in the rails/email business I'd better check with people with more expertise. I will send emails through sendgrid (planing to), but I want my emails to look good and respect html email principles that are quite different then plain browser html.

Any guidance would be greatly appreciated.

A couple of railcasts : Sending HTML Email and Action mailer in rails 3

Upvotes: 2

Views: 111

Answers (1)

Benjamin Bouchet
Benjamin Bouchet

Reputation: 13181

The gem mail is already installed in your application, cause it's a dependency of actionmailer.

If your email looks weird, maybe you should check how to format them. For example you cannot import CSS in emails, it's advise for your style to be inline etc... Also complex div structure may have unwanted results. There is a lot of limitations.

Roadie gem will certainly help you to generate correct format for emails. Aside of reading documentation and best practice advises on the limitation of HTML in email I don't think you need anything else

Upvotes: 2

Related Questions