-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappscript.js
More file actions
27 lines (23 loc) · 931 Bytes
/
appscript.js
File metadata and controls
27 lines (23 loc) · 931 Bytes
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
function doPost(e) {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var data = JSON.parse(e.postData.contents);
var email = data.email;
var about = data.about || "";
var timestamp = new Date();
// Append to sheet
sheet.appendRow([email, timestamp, about]);
// Send notification to you
MailApp.sendEmail({
to: "ankush4singh@gmail.com",
subject: "New Waitlist Signup: " + email,
body: "New signup on Construct waitlist.\n\nEmail: " + email + "\nAbout: " + about + "\nTime: " + timestamp.toISOString()
});
MailApp.sendEmail({
to: "naiknischal91@gmail.com",
subject: "New Waitlist Signup: " + email,
body: "New signup on Construct waitlist.\n\nEmail: " + email + "\nAbout: " + about + "\nTime: " + timestamp.toISOString()
});
return ContentService
.createTextOutput(JSON.stringify({ result: "ok" }))
.setMimeType(ContentService.MimeType.JSON);
}