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
//Sample email that is received and whose details are extracted: | |
/* | |
*Someone* just submitted your form named Online Course Booking from your | |
website | |
https://www.abcd.com/ | |
Message Details | |
Full Name: Mohamed Ali | |
Email Address: [email protected] | |
Phone Number: 009725991122334 |
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
exports = async function(payload) { | |
const mongodb = context.services.get("mongodb-atlas"); | |
const eventsdb = mongodb.db("googlesheetsdb"); | |
const eventscoll = eventsdb.collection("employee_records"); | |
const result= await eventscoll.insertOne(payload.query); | |
var id = result.insertedId.toString(); | |
if(result) { | |
return JSON.stringify(id,false,false); | |
} | |
return { text: `Error saving` }; |
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
var ui = SpreadsheetApp.getUi(); | |
function onOpen(e){ | |
ui.createMenu("Gmail Manager").addItem("Get Emails by Label", "getGmailEmails").addToUi(); | |
} | |
function getGmailEmails(){ | |
var input = ui.prompt('Label Name', 'Enter the label name that is assigned to your emails:', Browser.Buttons.OK_CANCEL); | |