I’ve been hosting a Ghost blog now for multiple weeks and it’s been pretty good. It took me a while to setup members and newsletter sending, but finally – I’ve made it. When I finally started to do this, it took a whole lot longer than it should and the reason? Outdated and simply wrong tutorials, even from Ghost themselves! I had issues with Mailgun, and I got that infamous “can’t send magic link” thingy and some other stuff. Now I’m gonna tell you how to really fix it. Good luck!
When you setup Mailgun for Ghost, don’t verify your domain at once!
Yep. That’s true. I first setup a subdomain, that Mailgun recommends, like mg.mydomain.com
and i put in the values for MX, TXT etc, but after each thing, I verified and I think, I’m not sure however, that it led to my MX values not being verified. I waited for hours, and I checked them on a site I regularly use called whatsmydns.net and they had properly set. But nothing worked. I could send newsletters, because the function to do so showed up when I wanted to publish a post, but the test email failed to send. After a while I deleted the domain and changed it to something else and then I did everything – aka ALL THE STEPS before verifying and somehow that helped. I don’t know why though. If you do – leave a comment (and become member 😉) and let me know, because I’m lost.
You also get the “wrong” information from Mailgun when you’re setting up the API.
With “wrong” I might be wrong, because I’m a noob at this, so sorry if I’m not the best technical person in the area. I have a bad habit of reading to fast, missing steps and therefore I miss the whole picture, which also could have prolonged this newsletter sending business with Mailgun. Anywas. As a noob, which I’m not alone to be sometimes. I’m an experienced blogger, writing obsessively since 2006 on various platforms, mostly WordPress, but I’ve never been successful. Anywho, I’m not gonna stray too far away from this subject of setting up newsletters and memberships. You also need to create your sending API and use that as well instead of where Ghost is telling you on the newsletter setup page. At least it seems so.
The wrong information that is so easy to miss is the url. Let’s say you’re domain you want to use is example.com
. The info you’ll get from Mailgun is like this: https://api.mailgun.com/v3/example.com/whatever
and because of that, you could believe that you’re supposed to put in the whole nine yards from https://
to the last letter of the url. But that’s wrong. You only need your domain that you’ve entered to Mailgun. If that is example.com
or mg.example.com
that’s the only thing you need. All tutorials besides one that I’ve found about this said to put in the whole shebangs, and that is wrong. At least today in late may 2023. It might have been right in 2019… Who’s to say? Yes, that was a Craig Federighi meme 😂
The SMTP stuff is also misleading when it comes to newsletters and signing up as a member on Ghost with Mailgun.
This however might differ, depending on where you live in the world, but NONE of the tutorials out there worked for me. Ghost themselves give you this for example to put in you config.production.json
file:
"mail": { "transport": "SMTP", "options": { "service": "Mailgun", "host": "smtp.mailgun.org", "port": 465, "secure": true, "auth": { "user": "postmaster@example.mailgun.org", "pass": "1234567890" } }},
I had to put in different things. Of course I understood that I need to change the user and password to what I got from Mailgun, but I also had to create a new SMTP user over at Mailgun and make sure that either “eu” or “us” was in the host SMTP url. My setup looks like this:
"mail": { "transport": "SMTP", "options": { "service": "Mailgun", "host": "smtp.eu.mailgun.org", "port": 465, "secure": true, "auth": { "user": "noreply@subdomain.example.com", "pass": "lotsofweirdnumbersandletterstobesafeaspassword" } } },
When I did this, and of course restarted Ghost – it worked! But it should have worked in like less then an hour. I probably spent 4 or o more on this, but I’m a new developer. A junior with very little help from school and others in my background + I have fibromyalgia (brain fog and all that crap) that makes everything harder. Either way – I hope this helps you. If it did, become a member and leave a comment!