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(); | |
messages.forEach(function(message) { | |
var body = message.getBody(); |
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
// Helper function to check if an email is already in the sheet | |
function isAlreadyLogged(email, sheet) { | |
var data = sheet.getDataRange().getValues(); // Get all values in the sheet | |
for (var i = 0; i < data.length; i++) { | |
if (data[i][0] === email) { | |
return true; // Return true if email is already logged | |
} | |
} | |
return false; // Return false if the email is not in the sheet | |
} |
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
// Helper function to extract the first email address found in a given text | |
function extractEmail(body) { | |
var emailPattern = /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/; // Regex pattern to match an email address | |
var match = body.match(emailPattern); // Find the first email that matches the pattern | |
return match ? match[0] : null; // Return the email if found, otherwise return null | |
} |
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(); | |
messages.forEach(function(message) { | |
var body = message.getBody(); // Get the body content of the email |
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 | |
}); | |
} |
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'); // Fetch the "unsubscribed" label from Gmail | |
var threads = label.getThreads(); // Get all threads with this label | |
var sheet = SpreadsheetApp.open(DriveApp.getFileById('REPLACE_WITH_GOOGLE_SHEET_ID')); // Open the target Google Sheet | |
} |
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'); // Fetch the "unsubscribed" label from Gmail | |
var threads = label.getThreads(); // Get all threads with this label | |
} |
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'); // Fetch the "unsubscribed" label from Gmail | |
} |
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() { | |
// Additional code will go here | |
} |
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
const handleSlideRight = () => { | |
document.getElementById("colorContent").scrollTo({ | |
top: 0, | |
left: Math.max( | |
(scrollAmount += 5), | |
document.getElementById("colorContent").clientWidth | |
), | |
behavior: "smooth", | |
}); | |
}; |
NewerOlder