0

所以这是我使用的自动回复功能。我在如何从中排除具有特定用户名的域和/或电子邮件地址时遇到问题。我将非常感谢提供的任何帮助。谢谢你。

function autoReply(){
  var interval = 5;    //  if the script runs every 5 minutes; change otherwise
  var date = new Date();
  var day = date.getDay();
  var hour = date.getHours();
  var body = "Message"
  var htmlMessage = "htmlMessage" 
  if ([6,0].indexOf(day) > -1 || (day == 5 && hour >= 17) || (day == 1 && hour >= 8)) {
    var timeFrom = Math.floor(date.valueOf()/1000) - 60 * interval;
    var threads = GmailApp.search('is:inbox after:' + timeFrom);
    for (var i = 0; i < threads.length; i++) {
      if (threads[i].isUnread()){
       threads[i].reply(body, {htmlBody: htmlMessage});
       threads[i].markRead();
       threads[i].markImportant();
      }
    }
  }
}

4

0 回答 0