【问题标题】:Google appscript sending duplicate emails谷歌应用脚​​本发送重复的电子邮件
【发布时间】:2019-12-05 14:36:58
【问题描述】:

这是脚本中的代码:

sendSubmissionEmail();

function sendSubmissionEmail() {

  var consultantEmail = 'example@staffingprojects.co.za';

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

设置为从表单提交触发,但每次发送重复邮件。

【问题讨论】:

    标签: google-apps-script


    【解决方案1】:

    我尝试了您的代码并遇到了同样的问题,因为您在脚本中有一个函数调用,然后您从触发器中调用它。

    尝试摆脱函数调用,你应该会很好。试试这样的:

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

    如果此修复不能解决您的问题,您应该提供有关如何设置触发器的更多信息。

    【讨论】:

      猜你喜欢
      • 2012-09-24
      • 1970-01-01
      • 1970-01-01
      • 2020-04-22
      • 1970-01-01
      • 2013-11-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多