-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcode.gs
32 lines (27 loc) · 960 Bytes
/
code.gs
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
function doGet() {
return HtmlService.createHtmlOutputFromFile('index')
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);
}
function getLinkForLastName(lastName) {
if (!lastName) {
return "Please enter a last name.";
}
const firstLetter = lastName.charAt(0).toUpperCase();
const zoomLinks = {
'AB': 'https://zoom.us/j/1111111111',
'CD': 'https://zoom.us/j/2222222222',
'EFG': 'https://zoom.us/j/3333333333',
'HIJ': 'https://zoom.us/j/4444444444',
'KL': 'https://zoom.us/j/5555555555',
'MNO': 'https://zoom.us/j/6666666666',
'PQR': 'https://zoom.us/j/7777777777',
'S': 'https://zoom.us/j/8888888888',
'TVWXYZ': 'https://zoom.us/j/9999999999'
};
for (const [letters, link] of Object.entries(zoomLinks)) {
if (letters.includes(firstLetter)) {
return `Your Zoom link is: ${link}`;
}
}
return "No Zoom link found for this last name. Please contact the organizer.";
}