Unsubscribe link?

Is there a way to generate or create an unsubscribe link for a given user?

Right now, the “suggested” method of implementing automation is to use Zapier + some other service (or mailgun even) to send automation emails. That’s fine, but those emails should have unsubscribe capability, and because they’re not generated by Ghost, there’s no way I can see to generate an unsubscribe link to insert into those emails. Maintaining 2 lists and keeping them in sync seems not great.

Happy to even write custom code (and share it) to do this if it’s something that can be calculated for a given user.

Answering here for anyone else searching for this. Unsubscribe link takes the format:

https://yourdomain.com/unsubscribe/?uuid=<member uuid>&newsletter=<newsletter uuid>

…in my case I only have 1 newsletter so I can just hardcode that, but the API does allow you to get that info if needed. So, rather than using Zapier or something, I have a small python script that I use as a webhook, so on member added, it can send a welcome email/enroll them into a sequence, and then generate the unsubscribe links and insert them into a template at mailgun.

1 Like