Multiple Ghost sites & Mailgun - Wrong Domain

I have two Ghost sites, and have set up newsletter sending for both on the same Mailgun account. Each site’s domain has been set up with Mailgun’s DNS, and that domain was entered into the Ghost Mailgun settings under “Mailgun Domain”.

Everything works as expected on Site 1. However when I send a newsletter from Site 2, the email headers show it is being sent via Site 1’s Mailgun domain.

I can’t seem to figure out if this is a bug in Ghost or I have misconfigured something. Anyone have insight into what might be going on?

I’d check that you don’t have site 1’s login info (api key etc) accidentally provided to site 2…

I think you are right, I had the global API key in both sites. If I test it with a domain API key it does work as expected and the headers appear with the correct domain.

I was under the impression the global API key was needed? Maybe not because it looks like tracking/analytics is working, contrary to this thread…

According to the Mailgun docs the domain is supposed to be included in the API call (which I assume is why Ghost asks for it in the settings). So it seems that if you use the global user API key then it does not respect the “Mailgun domain” you set in the Ghost Admin.