Failed to send magic link email. i am setup the mailgun. what i do now?
Thanks all
If you’d like help, please post some more information. How did you install ghost? Post the contents of production.config.json (minus passwords). Any errors in the ghost logs? Any errors on the mailing console?
I’m sorry, I have never used it before. So no idea about this. I have auto-installed it via Digitalocean.
mailgun:
light sort SS
ghost panel: SS
OK, so your transactional email is probably not configured. You need that.
See this page, specifically the section on configuring transactional email:
What do the logs say when you run ghost log
?
i am getting this log after ghost log
command:
A ConfigError occurred.
Error detected in the production configuration.
Message: You have excluded file logging in your ghost config. You need to add it to your transport config to use this command.
Configuration Key(s): logging.transports
Current Value(s):
Help: Run `ghost config <key> <new value>` for each key to fix the issue.
Debug Information:
OS: Ubuntu, v22.04.3 LTS
Node Version: v18.17.1
Ghost Version: 5.87.0
Ghost-CLI Version: 1.26.0
Environment: production
Command: 'ghost log'
Try running ghost doctor to check your system for known issues.
You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.
i am also get this when i type ghost doctor
:
âś” Checking system Node.js version - found v18.17.1
â„ą Ensuring user is not logged in as ghost user [skipped]
â„ą Checking if logged in user is directory owner [skipped]
âś” Checking current folder permissions
âś– Validating config
âś” Checking content folder ownership
âś” Checking memory availability
âś” Checking binary dependencies
âś” Checking free space
One or more errors occurred.
1) Validating config
Error detected in the production configuration.
Message: Config file is not valid JSON
Debug Information:
OS: Ubuntu, v22.04.3 LTS
Node Version: v18.17.1
Ghost Version: 5.87.0
Ghost-CLI Version: 1.26.0
Environment: production
Command: 'ghost doctor'
Try running ghost doctor to check your system for known issues.
You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.
Sounds like it’s time to check your config file for an error. Extra comma? Missing } ?
it is ok, or not?
"mail": {
"transport": "SMTP",
"options": {
"service": "Mailgun",
"auth": {
"user": "postmaster@email.environst.us",
"pass": "6744bfb7b7f25226a****"
}
}
},
You’re missing a comma before mail, looks like!
like this?
The JSON should be one coherent block of key-value pairs:
{
"key1": "value1",
"key2": "value2",
"key3": {
"subkey1": "subvalue1",
"subkey2": "subvalue2"
}
}
From the limited screenshot it looks like you have two “blocks” there. One that ends after the paths
object (see the closing }
after contentPath
and the closing}
in the next line) and one block that is dangling underneath, starting with mail
.
Here’s a more in-depth introduction to JSON:
And here you can validate your JSON files:
thank you, Can you make me mailgun smtp email sending JSON file? I would appreciate it if you could provide it.
the example mailgun email details:
smtp.mailgun.org
Our servers listen on ports 25
, 587
, and465
(SSL/TLS)
mail: postmaster@email.environst.us
password: 13668213621 (this is a fake password)
Thank you
Post your whole config file, with passwords replaced, in a code block, and we’ll check it. Like Jannis pointed out, your problem might be not in that email bit itself, but how you integrated it into the rest of the file.
Thank you so much, @Cathy_Sarisky and @jannis for Help me
now it’s work! I am using this code:
"mail": {
"transport": "SMTP",
"options": {
"service": "Mailgun",
"host": "smtp.mailgun.org",
"port": 587,
"secure": false,
"auth": {
"user": "mail@email.environst.us",
"pass": "demo"
}
}
},
Thank you so much