This file contains hidden or 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
// Copyright 2020 Google LLC | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// https://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
This file contains hidden or 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
// Copyright 2020 Google LLC | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// https://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
This file contains hidden or 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
// Column names in sheet. | |
const EMAIL = 'Email'; | |
const GOOGLE_GROUP = 'Google Group'; | |
const ALLOWED = 'Allowed'; | |
const EMAIL_TEMPLATE_DOC_URL = 'Email template doc URL'; | |
const EMAIL_SUBJECT = 'Email subject'; | |
const EMAIL_STATE = 'Email state'; | |
// These represent whether an email was sent or not for a given row. | |
const EMAIL_STATE_VALUE = { |
This file contains hidden or 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
// Row indices. | |
const CUSTOMER_ID = 0; | |
const DATE = 1; | |
const AMOUNT = 2; | |
const MILLISECONDS_IN_MONTH = 1000 * 60 * 60 * 24 * 30; | |
/** | |
* Groups customers by their ID calculates | |
* customer lifetime value for each. |
This file contains hidden or 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
/** | |
* Calculates the total annual amount of an expense | |
* by multplying its amount by it's frequency. | |
* | |
* @param {number} amount - dollar cost of an expense. | |
* @param {number} frequency - annual, monthly, or weekly. | |
* | |
* @returns {number} - annual cost | |
*/ | |
function ANNUAL_COST(amount, frequency) { |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<h1>Let's send you a text</h1> | |
<p>Please enter your phone number without any special characters or spaces.</p> | |
<label>Phone number: </label><input type="text" id="phoneInput" placeholder="ex: 9990001234"> | |
<button id="submitButton">Submit</button> | |
<script> | |
document.getElementById('submitButton').addEventListener('click', function() { | |
// Get the value from the `phoneInput` text box. |
This file contains hidden or 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 SHEET_URL = 'ENTER_SPREADSHEET_URL_HERE'; | |
/** | |
* Loads main web app page. | |
* Learm more about web apps: | |
* https://developers.google.com/apps-script/guides/web | |
* | |
* @param {Object} e - HTTP GET event. | |
*/ | |
function doGet(e) { |
This file contains hidden or 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
// Spreadsheet column names mapped to 0-based index numbers. | |
var TIME_ENTERED = 0; | |
var PHONE_NUMBER = 1; | |
var MESSAGE = 2; | |
var STATUS = 3; | |
// Enter your Twilio account information here. | |
var TWILIO_ACCOUNT_SID = 'PASTE_TWILIO_ACCOUNT_ID_HERE_EX: ACa0072e7863c5d13b703e1e18f7cab1ee'; | |
var TWILIO_SMS_NUMBER = 'PASTE_TWILIO_SMS_NUMBER_HERE_EX: 14155925860'; | |
var TWILIO_AUTH_TOKEN = 'PASTE_TWILIO_AUTH_TOKEN_HERE_EX: AC4z072e7863c5d13b703e1e18f7cab1ee:046077789202b8d7166de7a0d3383d9f'; |
This file contains hidden or 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
/** | |
* Assigns a type of room needed for a session based on its number of | |
* registered participants. | |
* | |
* @param {number} numParticipants - number of participants. | |
* | |
* @returns {string} - size of room. | |
*/ | |
function ROOM_TYPE(numParticipants) { | |
if (numParticipants <= 25) { |
This file contains hidden or 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
{ | |
"timeZone": "America/Los_Angeles", | |
"dependencies": { | |
}, | |
"exceptionLogging": "STACKDRIVER", | |
"sheets": { | |
"macros": [{ | |
"menuName": "createChartsFromAnalytics", | |
"functionName": "createChartsFromAnalytics" | |
}] |
NewerOlder