Send emails using Mailgun from your Capistrano recipes
The guys over at Mailgun just posted an overview of how to use Mailgun to power email notifications from your Capistrano recipes. We've got a lot of customers using Capistrano to automate their big web deployments, so we thought we'd share a summary. You can read the full post on the Mailgun blog.
If you're using Capistrano, you can use this code, written by Spike Grobstein, Mailgun customer and Senior DevOps Engineer at Ticket Evolution, to automatically send a notification after deployment (here's the Github code). Just add the following to your deploy.rb file:
That's it. When you deploy, it should automatically send an email using the built-in text and HTML templates. You can also send emails that include more sophisticated variables, create different notification emails for different mailing lists (e.g. firstname.lastname@example.org or email@example.com) or customize the emails. Grab that code on Github.
I hope this makes managing epic deployments a little easier for you!