0
votes

this is the code in the script:

sendSubmissionEmail();

function sendSubmissionEmail() {

  var consultantEmail = '[email protected]';

  {
   var subject = 'New Submission Notification - Example' ;
   var message = 'Hello, a new form has been submitted!';
  }
    // Send the email
  MailApp.sendEmail(consultantEmail, subject, message);
}

It is set up to trigger from the submit on a form, but sends duplicate mails every time.

1

1 Answers

0
votes

I tried your code and got the same problem because you have a function call in the script and then you call it from the trigger.

Try to get rid of the function call and you should be good. Try something like this:

//sendSubmissionEmail();

function sendSubmissionEmail() {

  var consultantEmail = '[email protected]';

  {
   var subject = 'New Submission Notification - Example' ;
   var message = 'Hello, a new form has been submitted!';
  }
    // Send the email
  MailApp.sendEmail(consultantEmail, subject, message);
}

If this fix doesn't solve your problem you should provide more information about how you have set up your triggers.