View gist:9d5fb8e89057300fd86e95d5885115fe
This file contains 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
function process() { | |
var threads=GmailApp.search('from:___@____.ru is:unread subject:"Отправка Заявка" OR subject:"Отправка Форма"'); // ищем нужные письма | |
for (var i=0; i<threads.length; i++) { // перебираем их все | |
var messages=threads[i].getMessages(); | |
for (var j=0; j<messages.length; j++) { | |
var info=parseInfo(messages[j].getBody()); // парсим данные | |
var res=sendFirstMail(info.mailTo, info.name, "reg0"); // пишем сообщение контакту | |
// Вызов функции записи в Firebase | |
callFirebase(info.name, info.mailTo.toLowerCase(), info.mobile,'звонок по форме','[трубы]Обращение на форме от Имя: '+info.name+' Емейл: '+info.mailTo.toLowerCase()+' Телефон: '+info.mobile+', заполнить анкету, узнать потенциал', "трубы"); | |
createDelivery(info.mailTo); |
View gist:f25a73ced79ae77a2a5ca1ad4790e797
This file contains 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
mailHtml=mailHtml+"<table><caption><h4> ЗАДАЧИ </h4></caption"; | |
var todayTasks=getTodayTasks(); | |
for (var i=0; i<todayTasks.length; i++) { | |
mailHtml=mailHtml+"<tr id='"+todayTasks[i].id+"'>"; | |
mailHtml=mailHtml+"<td>"+todayTasks[i].title+"</td>"; | |
mailHtml=mailHtml+"<td><button onclick='this.hidden=true'>Выполнено</a></td>"; | |
mailHtml=mailHtml+"<td><button>На завтра</button></td>"; | |
mailHtml=mailHtml+"<td><button>На следующую неделю</button></td>"; | |
mailHtml=mailHtml+"</tr>"; | |
} |
View ChatCode.gs
This file contains 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 USERS=[]; // массив электронных адресов электронной почты участников чата, зарегистрированной в Google | |
var DAYS=['понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота', 'воскресенье']; | |
var HTML_BODY='<a href="адрес публикации скрипта/exec?param=##PARAM##">ХОЧЕШЬ ЗАРАБОТАТЬ МИЛЛИОН?</a>'; | |
function doGet(e) { | |
var myCashe=CacheService.getScriptCache(); | |
var par=e.parameter.param; | |
var code=myCashe.get(Session.getActiveUser().getEmail()); | |
if (par==null) // защита от вызова без параметра |
View code.gs
This file contains 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
function onOpen() { | |
var curSheetUi=SpreadsheetApp.getUi(); | |
curSheetUi.createMenu('Планирование') | |
.addItem('Очистить график', 'clearPlan') | |
.addItem('Сформировать график', 'makePlan') | |
.addToUi(); | |
} | |
function clearPlan() { |
View FormHandler.gs
This file contains 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 MYORDERS='ID таблицы записей'; // таблица записей | |
var ORDERCAL="ID календаря"; // календарь записей | |
var TEXT_EMAIL='<font size=4 face="fantasy"> Добрый день!</font><br> Мы записали Вас ##DATE##, время: ##TIME##! <br> С нетерпением ждем Вас!'; | |
var CANCEL_EMAIL='<font size=4 face="fantasy"> Добрый день! </font><br> Время, которое Вы выбрали занято, выберите другое, пожалуйста!'; | |
var HOLIDAY_EMAIL='<font size=4 face="fantasy"> Добрый день! </font><br> Вы выбрали для записи праздничный день, выберите другой день, пожалуйста!'; | |
var WEEKEND_EMAIL='<font size=4 face="fantasy"> Добрый день! </font><br> Вы выбрали для записи выходной день, выберите другой день, пожалуйста!'; | |
function onSubmitForm(e) { | |
View codeAPI.gs
This file contains 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 ID='вставьте сюда ID своей таблицы с единым реестром операций'; | |
function doGet(e) { | |
try { | |
var indexOfTochka=e.parameter.table; | |
if (indexOfTochka!=undefined) uploadTable(indexOfTochka); | |
} catch (err) {return err}; | |
return 0; | |
} |
View start.gs
This file contains 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 LIST_ID='тут поставить ID таблицы реестра платежей'; | |
Array.prototype.findByPropName = function(name){ | |
for(var i = 0; i < this.length; i++){ | |
if(this[i].key == name) return this[i] | |
} | |
return {value: undefined}; | |
} | |
function callTrigger() { |
View index.html
This file contains 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> | |
<head> | |
<link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css"> | |
<base target="_top"> | |
</head> | |
<script> | |
function Okay() { | |
document.getElementById("butOkay").disabled=true; |
View search.gs
This file contains 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
Array.prototype.findByPropName = function(name){ | |
for(var i = 0; i < this.length; i++){ | |
if(this[i].key == name) return this[i] | |
} | |
return {value: undefined}; | |
} | |
function onOpen() { | |
addMenu(); |
View Page.html
This file contains 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> | |
<head> | |
<base target="_top"> | |
<link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css"> | |
<script> | |
function turnOffButtons() { | |
for(var index=1; index<=6; index++) { | |
var b=document.getElementById("but"+index); | |
b.hidden=true; |
NewerOlder