Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clearer set-up documentation #26

Open
mattias78 opened this issue Jul 21, 2022 · 6 comments
Open

Clearer set-up documentation #26

mattias78 opened this issue Jul 21, 2022 · 6 comments
Labels

Comments

@mattias78
Copy link

Description

With the set-up instructions it would be great if it could clearly communicate:

  1. which Mailgun API key to use (Private or Public)
  2. what (or how to access) the required 'Endpoint' - not obvious from the Mailgun dashboard?
@mattias78 mattias78 added the bug label Jul 21, 2022
@bymayo
Copy link

bymayo commented Oct 19, 2022

Just a follow-up on this as I also struggled to figure out what was needed.

Domain
Add the URL without https:// e.g. website.com

API Key
Get this from Mailgun via Sending > Domains > YOUR_DOMAIN_NAME > Domain Settings (You might need to open 'Sending' again in the sidebar) > Sending API Keys

In there create a new API key

Endpoint
This was the tricky bit for me! As I couldn't find it ANYWHERE, but luckily checking out Mailgun's docs I found:

https://api.mailgun.net/v3/YOUR_DOMAIN_NAME/messages

But if your using EU location use:

https://api.eu.mailgun.net/v3/YOUR_DOMAIN_NAME/messages

Storing these all as env vars in the .env works a treat also and more secure, like:

MAILGUN_DOMAIN="website.com"
MAILGUN_API_KEY="1a2b3c4d5e6f7g8h9i0j"
MAILGUN_ENDPOINT="https://api.mailgun.net/v3/website.com/messages"

Would be good if this was in the docs so it didn't waste time digging around to find this though!

@mattias78
Copy link
Author

Thats great thanks Jason.

Out of curiosity with the domain part did you include the 'mg' segment that Mailgun adds?

mg.website.com

or just

website.com

@bymayo
Copy link

bymayo commented Oct 20, 2022

@mattias78 I didn't, I think the Domain is just how you add the domain in Mailgun. I suppose if you've added it with a subdomain (It suggests doing this doesn't it) then you would add it in. But we don't add any subdomains on.

@damienbuckley
Copy link

Thanks for this info - I was having trouble too. Worth noting that if you're using the sandbox domain for testing, the test will only work if you add yourself as an Authorised Recipient in Mailgun

@icreatestuff
Copy link

icreatestuff commented May 4, 2023

Thanks for the instructions!
It was the mailgun endpoint that had me stumped for a while. If you're using the EU location this needs to be set to https://api.eu.mailgun.net - leaving this field empty or using https://api.mailgun.net doesn't work.

Definitely worth P&T doing a quick update of the docs/readme.

@iparr
Copy link

iparr commented Dec 8, 2023

Thanks for your help everyone above, but none of that was working for me. What did work for me was:

MAILGUN_DOMAIN="m.website.com"
MAILGUN_API_KEY="key-XXXXXXXXXXXXXXXXXXXXXXXXX"
MAILGUN_ENDPOINT="https://api.eu.mailgun.net/v3/m.website.com"

I didn't create an API key (well, I did - but it did nothing!). Instead I used the "HTTP webhook signing key" from 'Sending > Webhooks'.

Why? No idea. But it works.

(Things were a lot clearer using Postmark, but a lot cheaper using Mailgun)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants