Finally a clone of Mailgun API! (aka you can send newsletters with your SMTP)

Hi all!
Finally today I released the first version of a clone of Mailgun’s REST API!

The main working API is the API that send emails. Stats and advanced features are not yet supported, but you can send newsletters :-P

This way, all the users disappointed that you couldn’t use your own SMTP server, you can use this web application, configure it with your own SMTP server and send newsletters from Ghost making them think they are using Mailgun, but they actually use the same API but through their own free web service.

The only (little) issue is that you have to make a manual change on MySQL to your installation to tell Ghost what the address of your own web service is. You need to edit in the settings table by modifying the record with key=‘mailgun_base_url’.

To avoid this `hack’, I ask the Ghost team to put a third option in Ghost’s Mailgun settings, where you currently choose the US or EU zone, adding CUSTOM or something similar, so that you can enter the URL of your “fake” Mailgun server. This will make many users very happy without making heavy code changes to use a pure SMTP server :-)

PS: if you like the project, based on this complexity, you can make a donation (read the README) :-D

5 Likes

Please do not edit the MySQL database for this. If you’re already self-hosting, you have a configuration somewhere. Either environment variables (Docker) or a config.[environment].json.

Use that.

For environment varibles set mail__options__host bulkEmail__mailgun__baseUrl to the URL.
For the JSON file, set mail.options.host bulkEmail.mailgun.baseUrl to the URL.

1 Like

This option is useful for transational emails, but bulk emails for newsletters ignore these mail settings as documented :-(

LOL my bad.

It’s bulkEmail__mailgun__baseUrl and bulkEmail.mailgun.baseUrl respectively.

2 Likes

Very interesting, I will try it, thanks a lot!

2 Likes

This means, Mailgun is still the only offical supported provider? I can not just use a service like Resend?

Yes, correct:

Thanks, so to wrap it up:

  1. as a ghost pro user, its an included feature, no headaches
  2. if self hosted I have to setup Mailgun
  3. Though I can always sync members to an external solution and take it from there (passing on the build in posting/sending capabilities … which at least is for me a strong selling point:))

Yes, that’s a pretty good summary. Plus, most other managed hosting providers apart from Ghost(Pro) also include the email setup