-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCode.js
33 lines (26 loc) · 1.08 KB
/
Code.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// FOR NEW Account need to do following:
// enable > Resources/Advanced Google Services > Gmail API and Drive API
// (also check to make sure they are activated in Google Cloud Platform API Dashboard)
//******************************************************************************************************
// adds menu items in spreadsheet when opened
function onOpen(e) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = [];
// When the user clicks on "Newsletter" then "1 Insert Email text", the function pullingEmails is executed.
menuEntries.push({name: "1 Insert Email text", functionName: "pullingEmails"});
menuEntries.push(null); // line separator
menuEntries.push({name: "2 Send as Word doc my Email", functionName: "sendingEmails"});
ss.addMenu("Newsletter", menuEntries);
}
//***********************************************************************************
function pullingEmails(){
emailToSpreadsheet();
replace();
sort();
}
function sendingEmails(){
mailMergeToDocs();
addImages();
emailAsDocx();
}
function isOdd(num) { return num % 2;}