Skip to content

Instantly share code, notes, and snippets.

View moayadhani's full-sized avatar
😎
Creating

Moayad Hani moayadhani

😎
Creating
  • Malaysia
View GitHub Profile
@moayadhani
moayadhani / ExtractSpecificTextFromEmail.txt
Last active March 7, 2024 07:02
Extract Email Text from Google Sheet using App Script
//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: abcd123@gmail.com
Phone Number: 009725991122334
@erajanraja24
erajanraja24 / MongoDB Webhook function
Created December 13, 2019 18:02
MongoDB Webhook function
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` };
@moayadhani
moayadhani / GetGmailEmails.gs
Last active March 7, 2024 21:05
Get Gmail Emails By Assigned Label
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);