Make onboarding emails also work via API (not only SMTP)

The following problem:

I had some issues setting up SMTP for Digital Ocean. And also other hosters, since there seems to be a tendency towards “we will not allow SMTP traffic” for a good reason. Please also refer to this thread: Use Mailgun API, instead of SMTP for onboarding-emails?

The idea here is now: Why not make ghost available to use API-calls, like the one we have with mailgun, to get the onboarding emails gone right.

Right now I can live with the “workarounds”, like using ports not suitable for SMTP. But this might be just a matter of time, since ports getting blocked.

Solution:

Make an API option for onboaring-emails as well. (like mailgun API, that is already heavily promoted).

I would assume, that this would bring a so much more flexibility to open-source hosting.

Ghost should support using Mailgun via API for transactional email. Can you try the configuration from this portion of the docs?

Vikas, the docs don’t show an example with Mailgun API, only SMTP. Might be a docs problem, though!

heh my bad, I saw the section and walked read right past it :upside_down_face:

Reading the wrapper code and nodemailer-mailgun-transport docs, I think something like this might work:

"mail": {
    "transport": "mailgun",
    "options": {
        "host": "<>",
        "auth": {
            "api_key": "<>",
            "domain": "<>"
        }
    }
}
3 Likes

Amazing!

It absolutely works! Would be great, to have this mentioned in the docs. But at least we have now this searchable in the forums.

Thanks again!

3 Likes

Seconding this update to the docs when possible. I spent 1-2 days just to discover this as Digital Ocean has now blocked sending with SMTP. The workaround with port 2525 is working but not sure for how long. My suggestion is to please mention this somewhere in the docs that it could be caused by Digital Ocean’s blocking as I have 5 separate websites running on ghost hosted by digital ocean that I now need to reconfigure.

Thank you.

Just adding a full config example here for anyone who needs it.

  "mail": {
    "transport": "mailgun",
    "from": "an-email-address-that-i-confirmed-with-mailgun@mydomain.tld",
    "options": {
      "auth": {
        "api_key": "my-big-long-api-key-string-from-mailgun",
        "domain": "mg.mydomain.tld"
      },
      "host": "api.mailgun.net"
    }
  },

This is what I’ve got live on my server on 5.121.