//==============================================
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* 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
*
* http://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,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function myFunction() {
var triggers = ScriptApp.getProjectTriggers();
for(var i in triggers) {
ScriptApp.deleteTrigger(triggers[i]);
}
ScriptApp.newTrigger("SendHold")
.forForm(FormApp.getActiveForm())
.onFormSubmit()
.create();
}
//=========================================================
function SendHold(e)
{
try
{
//====== MSA LALALU
var message = "";
var s = FormApp.getActiveForm().getResponses();
var items = s[s.length-1].getItemResponses();
for (var j = 0; j < items.length; j++) {
var item = items[j];
message+= item.getItem().getTitle() + "=" + item.getResponse()+ "\n";
Logger.log('Response #%s to the question "%s" was "%s"',(s.length).toString(),item.getItem().getTitle(),item.getResponse());
}
//====== MSA LALALU
/*
var s = FormApp.getActiveForm().getResponses();
var message = "";
for (var i = 0; i < s.length; i++) {
message='';
var items = s[i].getItemResponses();
for (var j = 0; j < items.length; j++) {
var item = items[j];
message+= item.getItem().getTitle() + "=" + item.getResponse()+ "\n";
Logger.log('Response #%s to the question "%s" was "%s"',(i + 1).toString(),item.getItem().getTitle(),item.getResponse());
}
}
*/
GmailApp.sendEmail("xxxxx@gmail.com", "form test","isi" + "\n" +message,{name: 'Form Layanan Desa'})
} catch (e) {
Logger.log(e.toString());
MailApp.sendEmail("xxxxx@gmail.com","err log",e.toString() + '\n' + msg);
}
}
//===================================================
Langganan:
Posting Komentar (Atom)
-
Tutorial ini menjelaskan bagaimana menghapus blog di blogger. Pertama, anda harus login ke blogger.com, kemudian pilih blog yang hendak anda...
-
this tutorial based on post : https://stackoverflow.com/questions/1644201/how-can-i-display-code-better-on-my-blogger-blog Click on ...
-
sudo passwd root ---------------------STATIC IP ============================================== sudo cp /etc/network/interfaces /etc/networ...
Tidak ada komentar:
Posting Komentar