Last active
May 2, 2022 19:53
-
-
Save nonsocchi/85b6fc3707eb3d1045e7eb834ebb9578 to your computer and use it in GitHub Desktop.
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
// FILTERING EMAILS... | |
function getBankEmails() { | |
// This function searches for messages from emails having subject containing | |
// “GeNS transaction Alert …” | |
var filter = "subject:GeNS transaction Alert"; | |
var threads = GmailApp.search(filter, 0, 10); | |
var messages = []; | |
for (var x in threads) { | |
var thread = threads[x] | |
messages.push(thread.getMessages()[0]); | |
} | |
return messages; | |
} | |
function displayEmails() { | |
var templ = HtmlService.createTemplateFromFile('messages'); | |
templ.messages = getBankEmails(); | |
return templ.evaluate(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment