Been discussing with Mailgun and it seems the issue isn’t there. Here’s what I’m getting, followed by what I’ve done so far:
Error with transactional email when trying to sign-up a test user to the newsletter:
POST https://wevchange.org/members/api/send-magic-link/
Response: 500 Internal Server Error
```
{
“errors”: [
{
“message”: “Failed to send email. Reason: Sending failed.”,
“context”: null,
“type”: “EmailError”,
“details”: null,
“property”: null,
“help”: “Please see Configuration - Ghost Developer Docs for instructions on configuring email.”,
“code”: null,
“id”: “b992da60-db6e-11f0-95e4-cf1f9b02b80c”,
“ghostErrorCode”: null
}
]
}
```
I assumed perhaps it was due to SMTP configuration (but I assume newsletter signup is through the API…maybe it was failing due to a transactional email not sending?) So gathered the SMTP config from Mailgun, made sure to use the subdomain, and added those to the config.local.json file for production.
I restarted, still same result. Anyone know what’s going on?
Ghost uses SMTP for transactional emails and the newsletters themselves go through the API in your settings. I suggest running ghost in a docker compose instance and including your SMTP credentials to the .env file. I suggest this as Ghost is moving in this direction as the official method of selfhosting. This will mitigate future migrations.
Could you please share your Ghost config.production.json, or the docker compose, redacting secrets? I suspect you’ve configured newsletters but not transactional email. You absolutely can send transactional email via Mailgun API (and it can be more reliable than using SMTP, which your host might block), but you do have to configure it.