Dear Ghost community,
I’m self-hosting my blog and have Mailgun configured for sending newsletters. For sign ups I used form that contacts “send magic link” endpoint (the one kindly provided by @Cathy_Sarisky).
I removed all membership JS files and I’m not tracking users in any way. I assume, the best way to unsubscribe would be by clicking “Unsubscribe” at the bottom of the newsletter, since I know it comes from a genuine subscriber.
The “unsubscribe”, as it is designed now, sends “uuid” and “action=unsubscribe” parameters, redirecting the user to the homepage.
How can I implement unsubscribe functionality without the Portal code? Is there a way to directly contact backend from the newsletter and send user on the “goodbye” page?
A good way to investigate would be to look at what happens when a user toggles off a newsletter, by opening up dev tools and looking at the network call. You’d want to replicate that call. I think your user would have to be logged in for that to work…
Another option would be to stand up a cloud function that uses the admin API to unsubscribe the member.
@Cathy_Sarisky, thank you for the advice! Unfortunately, I don’t use login functionality. The user only subscribes for the newsletter, later I know nothing about the user. The only thing he can do is to unsubscribe from the newsletter. All website visitors are completely anonymous.
If I can replicate that call being triggered from a newsletter - that would be great. Otherwise I would have to try the cloud function that uses the admin API, as you have suggested.
Maybe someone knows similar projects being done or at least has a documentation link?