Google Form Responses in a Notification Email -


i'm using form notifications add-on in google form. i've edited code.gs , creatornotification.html files , works fine - when google form submitted email. i'm trying of fields form submission email. edits i've added below, email notification stops working.

in code.gs script have:

function sendcreatornotification() {     var form = formapp.getactiveform();     var settings = propertiesservice.getdocumentproperties();     var responsestep = settings.getproperty('responsestep');     responsestep = responsestep ? parseint(responsestep) : 10;      function onformsubmit(e) {         //get information form , set variables         var first_name = e.value[2];          // if total number of form responses multiple of         // response step setting, send notification email(s) form         // creator(s). example, if response step 10, notifications         // sent when there 10, 20, 30, etc. total form responses         // received.         if (form.getresponses().length % responsestep == 0) {             var addresses = settings.getproperty('creatoremail').split(',');             if (mailapp.getremainingdailyquota() > addresses.length) {                 var template = htmlservice.createtemplatefromfile('creatornotification');                 template.summary = form.getsummaryurl();                 template.responses = form.getresponses().length;                 template.title = form.gettitle();                 template.responsestep = responsestep;                 template.formurl = form.getediturl();                 template.notice = notice;                 template.firstname = first_name;                 var message = template.evaluate();                 mailapp.sendemail(settings.getproperty('creatoremail'),                 form.gettitle() + ': case submission',                 message.getcontent(), {                     name: addon_title,                     htmlbody: message.getcontent()                 });             }         }     } } 

in creatornotification.html have:

<p><i>form notifications</i> (a google forms add-on) has detected      form titled <a href="<?= formurl?>"><b><?= title ?></b></a> has received <?= responses ?> responses far.</p>  <p><a href="<?= summary ?>">summary of form responses</a></p>  <p>first name:</p> <?= firstname ?> 

any direction appreciated.

you trying run two triggers. "add-on" code creates trigger. add-on creates "installable" trigger. have 1 trigger set form being submitted. onformsubmit(e) function "simple" trigger. so, have 2 triggers set run when form submitted. so, created conflict. if in resources menu, under current project's triggers, should see trigger defined sendcreatornotification() function.

here's can try. don't need seperate onformsubmit(e) simple trigger. sendcreatornotification() function, has event object available it. add e sendcreatornotification() function:

sendcreatornotification(e) 

the write code value out of e.


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -