E-mail in Rails with MailChimp and Mandrill, a comprehensive guide

Intro

This tutorial walks through adding e-mail to a Rails app, using MailChimp and Mandrill. We will:

  1. Add new users to a mailing list
  2. Send a welcome e-mail to new users
  3. Alert users when something happens in the app

Our example app is Puppify, an aggregator of cute puppy videos. Read the tutorial, and then check out the source.


Mailing lists vs. transactional e-mails

It is important to distinguish your app’s mailing list from its transactional e-mails. Generally, a mailing list is used for periodic announcements and marketing e-mails, while transactional e-mails are used to notify individual users of specific events.

Mailing lists

Mailing lists handle messages sent to all or many of your users. For instance, you might send a monthly update about new features, or promote a sale on gift certificates.

MailChimp is a popular tool for managing mailing lists. It’s free for many smaller lists.

Transactional

Transactional e-mails are sent to individual users in response to particular events.

Events might include:

  1. The customer was billed.
  2. A new video was posted to a category that the customer chose to monitor.
  3. A charge to the customer’s credit card failed.

When an action above occurs, we need to notify a particular user – or, as we cover in Advanced Transactional E-mail, multiple users.

Mandrill, from the folks at MailChimp, is a popular tool for sending transactional e-mails. It’s free for apps with low e-mail volumes.

Continue reading E-mail in Rails with MailChimp and Mandrill, a comprehensive guide