Created
November 1, 2024 10:21
-
-
Save danielcranney/10b26cf1c8c6ca8b6891a4a6d9142d0e to your computer and use it in GitHub Desktop.
newsletter unsubscription tracker / 08 - isAlreadyLogged() helper function.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
// 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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment