This tutorial walks through adding e-mail to a Rails app, using MailChimp and Mandrill. We will:
- Add new users to a mailing list
- Send a welcome e-mail to new users
- 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 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 e-mails are sent to individual users in response to particular events.
Events might include:
- The customer was billed.
- A new video was posted to a category that the customer chose to monitor.
- 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.