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
function checkEmptyValues(obj) { | |
for (var key in obj) { | |
if (obj[key] === "") { | |
// Do something | |
return; | |
} else { | |
// Do something else | |
} | |
} | |
} |
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").scrollBy({ | |
top: 0, | |
left: +150, | |
behavior: "smooth", | |
}); | |
}; | |
const handleSlideLeft = () => { | |
document.getElementById("colorContent").scrollBy({ |
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", | |
}); | |
}; |
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
// 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() { | |
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 | |
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'); | |
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'); | |
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
// 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 | |
} |
OlderNewer