Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danielcranney/11e42f9d95a6e4add4f19ecfcb579bcb to your computer and use it in GitHub Desktop.
Save danielcranney/11e42f9d95a6e4add4f19ecfcb579bcb to your computer and use it in GitHub Desktop.
newsletter unsubscription tracker / 03 - get threads with the unsubscribed label.js
// Logs emails from threads labeled "unsubscribed" to a Google Sheet
function logUnsubscribes() {
var label = GmailApp.getUserLabelByName('unsubscribed'); // Fetch the "unsubscribed" label from Gmail
var threads = label.getThreads(); // Get all threads with this label
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment