我有一個Google語音號碼和我的自動回覆設置,它會向每條消息發送一個自動回覆,我可以將其設置爲只發送一次每個對話/人?我在繼續談話時不再多次?Googe Apps腳本自動回覆每次會話一次
謝謝!
我的腳本如下:
function autoReplier() {
var labelObj = GmailApp.getUserLabelByName('autoreply');
var gmailThreads;
var messages;
var sender;
for (var gg = 0; gg < labelObj.getUnreadCount(); gg++) {
gmailThreads = labelObj.getThreads()[gg];
messages = gmailThreads.getMessages();
for (var ii = 0; ii < messages.length; ii++) {
if (messages[ii].isUnread()) {
msg = messages[ii].getPlainBody();
sender = messages[ii].getFrom().slice(16, 74);
MailApp.sendEmail(sender, "Auto Reply", "(Auto reply:) Hi, Thanks
for reaching out, I respond to text messages.......... ");
messages[ii].markRead();
messages[ii].moveToTrash();
}
}
}
}