|
|
|
|
|
by hansoolo
765 days ago
|
|
Funny! I am working on something similar for myself. But not restricted to just Gmail. I really want to clean up this mess in my accounts. How did you go about the unsubscribe functionality? Also, I think I saw that Gmail has that feature themselves now. |
|
As at Febuary, Gmail introduced new guidelines for bulk email senders to make it easy unsubscribe from by adding a value for "List-Unsubscribe"
https://support.google.com/a/answer/81126?hl=en&visit_id=638...
So unsubscribing is simply a POST request to the value of this email header (List-Unsubscribe) - which is a link and comes as part of the email headers in the Gmail API response
The alternative approach is to parse the content of the email and use regex to get the unsubscribe link using the likely words. e.g links with words like: unsubscribe, opt-out etc..
Yes, Gmail has the unsubscribe functionality. Unfortunately, you cannot mass unsubscribe. If you have over 100 unwanted subscriptions you would have to unsubscribe from each one at a time.
Hope that helps you