Testing Emails

We use Mandrill for sending emails. With Mandrill, the first 12,000 emails sent per month are free.

We don’t use tools like MailerPreviews or http://mailtrap.io . Instead, all outgoing emails in development and staging envrionment are intercepted and sent to a real email account for the project.

For testing an email, we actually deliver the email to an email address. All outgoing emails are intercepted and sent to a test email account for a project.

For example, for a project named CivicHack, we will create an email account named nonproduction.civichack@gmail.com. Now, all outgoing emails from staging and development are sent to this email address.

Since emails are delivered for real, we can open that email in various email clients like Gmail and Outlook to see how they look. Also, in this way, project emails from development and staging never end up in your personal inbox since the whole team knows the password to access nonproduction.civichack@gmail.com.

We use wheel to kickstart a new Rails application and wheel comes configured with the ability to intercept and forward emails in development and staging environment. In settings file, search for intercept_and_forward_emails_to to see how you can configure where the forwarded emails should go to.