Questions about Mailgun & Subscriptions

Hi,

Seeing how members is front and center. I wanted to learn more about using subscriptions/emails in a self-hosted way.

Reading threads around here. It seems that click / link tracking is only working if enabled through Mailgun. Do I have that right? They basically proxy the URLs and then you can capture the 1/0 flags from the API/webhooks.

Is that something you see moving into Ghost at some point or just leaving to the email professionals? I have a weird issue that when self-hosting with HSTS those rewritten URLs are not secure and thus never work.

It was an feature request opened in 2014 to Mailgun with support to basically make your own secure redirection routes, but here we are in 2021 and it isn’t supported so not sure if that will happen.

Next question is just confirming how this feature works. Does it work like Stripe in the sense that it listens to the events that mailgun emits over webhook for unsubscribe/click/open? Or does it just batch hit the API for events?

Mailgun recently released “Sending Keys” so I’m not sure if I can get away with just using a Sending API key or if I need a more generic one for all the API calls that may be used.

Finally, last question. I’ve been with Ghost since Kickstarter so my blog has just been updated over and over. I’m getting a bit confused now since I setup mailing in the config probably years ago at this point which uses the SMTP based Mailgun.

However, I see the new Portal settings wants me to use the API based Mailgun. So now I have both authentication methods in the blog? One in flat file configuration and other in UI? I assume the Portal one is strictly for bulk mail and the config in the flat file is for transaction mail - am I on base there?

Thanks thanks!

I got my answers. For future googlers (if any)

It seems that click / link tracking is only working if enabled through Mailgun.

Correct

Or does it just batch hit the API for events?

Hits API, no webhooks.

Mailgun recently released “Sending Keys” so I’m not sure if I can get away with just using a Sending API key or if I need a more generic one for all the API calls that may be used.

I could not - led to MESSAGE: Invalid private key

It was an feature request opened in 2014 to Mailgun with support to basically make your own secure redirection routes, but here we are in 2021 and it isn’t supported so not sure if that will happen.

This is supported now, just not very documented. Setup your own reverse proxy to mailgun and drop the CNAME and use an A record. I blogged about it to work around HSTS.

1 Like

Enabling link tracking in Mailgun can break the auth URLs so it’s not recommended. Ghost itself may implement it’s own click tracking at some point but nothing is planned for the immediate future afaik.

Does it work like Stripe in the sense that it listens to the events that mailgun emits over webhook for unsubscribe/click/open? Or does it just batch hit the API for events?

Ghost has it’s own unsubscribe links which the majority of unsubscribes will go through. Otherwise all open tracking, spam complaints, and Mailgun-initiated unsubscribes are handled via Mailgun’s events API so you’ll need an API key that can access that.

Config settings are for transactional email, you can use any provider for this. Transactional emails are for staff invites, member signup+signin, etc. The Mailgun settings in the UI are for sending bulk email newsletters to members, only Mailgun is supported for that.

1 Like

Thanks for the additional info. I guess I prematurely setup all this click tracking. Not sure how I got to that requirement in my head. It looks like you only need open tracking (1px image).

Hi @Kevin I just found my way to this post with a similar use case. I would like to integrate ghost with my CDP for clicks. Just curious, are there any plans for adding ghost webhooks for email events?

There aren’t any immediate plans to add it. I’d encourage you, though, to add the features to the Ideas with your use case. It’d be helpful to know which CDP you use and a bit more about how the events would be used.

Hi @RyanF for now I’m using the events passed out of mailgun via a callback. In mailgun these are only for deliveried which is modestly helpful. A call back in ghost for openned would be lovely. I’m using Tracardi. The events would be used to gain a deeper understanding of audience. I will add to Ideas