Started new GAS script for Gong emails. Downloaded William Sonoma templates.
This commit is contained in:
1
Scripts/GAS_GS/GongEmails/.clasp.json
Normal file
1
Scripts/GAS_GS/GongEmails/.clasp.json
Normal file
@ -0,0 +1 @@
|
||||
{"scriptId":"1ZNoNK6TYOdiSUd2FkcsluHuPr-3d9J-2ZuTFH_WHu08W1ASHP7I9N_yD","rootDir":"/Users/normrasmussen/Documents/Work/Scripts/GAS_GS/GongEmails"}
|
||||
24
Scripts/GAS_GS/GongEmails/Code.js
Normal file
24
Scripts/GAS_GS/GongEmails/Code.js
Normal file
@ -0,0 +1,24 @@
|
||||
function myFunction() {
|
||||
var thread = GmailApp.getInboxThreads()
|
||||
for (let x = 0; x < thread.length; x++ ) {
|
||||
if (thread[x].getMessages().length == 1) {
|
||||
var message = thread[x].getMessages()[0];
|
||||
if (message.getFrom().includes("do-not-reply@gong.io")) {
|
||||
var messageBody = message.getPlainBody();
|
||||
var subject = message.getSubject().split(":")[0]
|
||||
Logger.log(subject)
|
||||
var messageSub = messageBody.substring(
|
||||
messageBody.indexOf("Next steps"),
|
||||
messageBody.lastIndexOf("Want to")
|
||||
);
|
||||
var messagechunks = messageSub.split(/\d/);
|
||||
for (let i = 0; i < messagechunks.length; i++) {
|
||||
Logger.log(messagechunks[i])
|
||||
}
|
||||
// // if (messagechunks[i].includes("Next Steps")) {
|
||||
// // Logger.log(messagechunks[i])
|
||||
// // }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
7
Scripts/GAS_GS/GongEmails/appsscript.json
Normal file
7
Scripts/GAS_GS/GongEmails/appsscript.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"timeZone": "America/New_York",
|
||||
"dependencies": {
|
||||
},
|
||||
"exceptionLogging": "STACKDRIVER",
|
||||
"runtimeVersion": "V8"
|
||||
}
|
||||
Reference in New Issue
Block a user