AppsScriptPulse

Add unsubscribe link in emails using Google Apps Script

Provide your subscribers an option to opt-out of mailing lists by adding unsubscribe link using Google Apps Script.

A useful post on creating a system to allow users to indicate they wish to opt-out of further mailings (useful for PECR or similar electronic communications regulation compliance). The post has the broad steps and code needed for this solution and you will need to fill in some of the blanks like how to record the unsubscribe_hash in the Google Sheet.

Source: Add Unsubscribe link in emails using Google Apps Script