Ghost and Mailgun integration made easier
Written by Orlando Kalossakas
Categories: For Devs
3 minute read time
Ghost is a project conceptualized by John O’Nolan and Hannah Wolfe to reboot the experience behind writing content on the web. It is a blogging platform focused on making writing pleasurable and publishing simple. It’s also an open source platform. Ghost was started through a successful kickstarter campaign, smashing through their original goal of £20,000 to raise almost £200,000.
Mailgun as Ghost’s preferred email service
We are also a big proponent of open source software. Mailgun would not be here without OSS and we try to return the favor by open sourcing our tools and utilities to the community. The two most starred projects by the community on the Mailgun GitHub repo are Flanker, a parsing library for email addresses and MIME messages, and Vulcand a reverse HTTP proxy library written in Golang. We’ll be moving more and more of our code into the public domain in the future.
We knew about Ghost’s Kickstarter campaign but we started to take further notice when we started seeing significant referrals from Ghost’s documentation. Needless to say, when we discovered that Mailgun was the preferred email service provider for Ghost, we were a pleasantly surprised. It is a great feeling to know that our service was featured as the chosen email router. Even better, this didn’t come out of some marketing or biz dev campaign, just that they liked the product. Self-service APIs FTW!
Naturally, we want to support Ghost in any way we can. We recently put some effort into using Mailgun with Ghost even easier.
First, we improved the Ghost documentation for using Mailgun. Since Ghost is open-sourced it was as easy as submitting a pull request. We cleaned up some small issues and made it more clear how to add Mailgun credentials to the Ghost config file.
Then, we thought about how we could take this a step further and automate the process.
Mailghost is a simple app that takes your Mailgun API key and allows you to download a config file with your Mailgun credentials pre-populated.
The process is pretty straightforward:
- Sign up for Mailgun and retrieve your API key.
- Go to the Mailghost page to generate your config.js file with your Mailgun credentials included.
- Replace the downloaded config file in your root folder where Ghost is installed (
ghost/in our scenario case) and you’re ready to send emails!
Mailghost is built using
expressjs 4.0, the Mailgun API through the request module and the
Jade templating language. If you would like to read about how to build an API web-app using node.js make sure to tweet or leave a comment with your thoughts!
More Mailgun and Ghost in the future
As Ghost is continuously improving over time, with a planned public API release set for September 2014, you can expect more Mailgun goodness coming out of our labs. If you have a cool idea for Ghost that involves email, make sure to let us know.
Finally, Mailgun has been on a long and bumpy journey with blogging platforms. We started with Tumblr, mostly because it was quick and easy. However, it is proprietary and lacks a lot of features necessary to run a blog amongst a team of people. Then we moved to WordPress, which has all the features and plugins you could want but is a bit clunky and the publishing experience is not great. We’re hoping the third time is a charm with our recent switch to Ghost. Writing blog posts are now actually enjoyable. We definitely recommend checking it out.
Modified on: March 13, 2019
Stay up-to-date with our blog & new email resources
We'll let you know when we add new email resources and blog posts. We promise not to spam you.