We often see
unsubscribe email link in mail magazines.
But how would we implement it?
I know there are mainly two ways:
after clicking the link,
- it will unsubscribe the email magazine soon, and you can see “unsubscribed email successfully” message in the page.
- it will render the form for the action and you have to decide whether click the unsubscribe button or not.
The points are following:
- The subscription status is regularly defined in database column (at least I often see it).
- link should be
- changing the subscription status (a part of resource) should be
PATCH / PUTrequest.
I googled about it a little, but couldn’t find a good posts or articles, then I’ve decided to write down this memo for myself.
If I implement this feature, I will take the 2nd way.
- Set the link in the email
- form to unsubscribe will be rendered after clicking the link
- then the user can click the button
This must be better and rational solution for now.
My short Research
- Product Hunt: it might be
GETrequest and unsubscribed soon (the 1st patten).
- Youtube: it renders unsubscribe form and it’ll be unsubscribed if you click the button (the 2nd patten).
- Quara: the 2nd pattern
- Hatena Blog (Japanese Blog service): the 2nd pattern
- connpass (Japanese Communication service for Meetup / Conferences, etc): the 2nd pattern
I know the result might be biased a little, but I’m a bit relieved that I am not wrong so much.
It’s up to you! (oh my goodness!)
To be honest, I don’t waste my time by arguing with someone.
If I don’t like it, I’ll just send a pull-request :wink: