Created
November 1, 2024 10:19
-
-
Save danielcranney/0102681f7b818dda5facb36b533907aa to your computer and use it in GitHub Desktop.
newsletter unsubscription tracker / 05 - get all messages in thread.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Logs emails from threads labeled "unsubscribed" to a Google Sheet | |
function logUnsubscribes() { | |
var label = GmailApp.getUserLabelByName('unsubscribed'); | |
var threads = label.getThreads(); | |
var sheet = SpreadsheetApp.open(DriveApp.getFileById('1v77gBSUzF7evN5Rlnvsz27LgoHgowiLivPpAGeTMgBQ')); | |
threads.forEach(function(thread) { | |
var messages = thread.getMessages(); // Get all messages in the thread | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment