gpt4 book ai didi

gmail - 使用 Google Apps 脚本的 Gmail 短信通知 : how to display content of the email?

转载 作者:行者123 更新时间:2023-12-04 15:13:08 24 4
gpt4 key购买 nike

每次收到符合特定条件的电子邮件时,我都在处理 SMS 通知;我决定为此使用 Google App Scripts。

我特别受到以下文章的启发 https://developers.google.com/apps-script/articles/gmail_filter_sms .我还在 StackOverflow 中查看了相关问题 SMS Alerts for Important Mails in Gmail .

我通过在下次运行脚本时清理事件来改进来自 developer.google.com 的原始脚本(每次运行脚本时我都会收到 SMS 警报)。该脚本目前正在使用标签“SendText”并在日历“AlertSMS”中创建事件。

然而,我收到的短信只包含电子邮件的主题和作者:I 需要显示邮件内容 (或至少是其中的一部分)。我尝试将它添加到事件的描述中,但没有运气。有没有人知道如何做到这一点?

下面是我的脚本代码:

function sendText() {
var now = new Date().getTime();

// Delete old events
var events = CalendarApp.openByName('AlertSMS').getEvents(new Date('January 1, 2010 EST'), new Date(now-30000));
for (i in events) {
events[i].deleteEvent();
}

// Get list of emails to set alert for
var label = GmailApp.getUserLabelByName('SendText');
var threads = label.getThreads();

// Create new events for emails alert
for(i in threads){
var message=threads[i].getMessages()[0];
CalendarApp.openByName('AlertSMS').createEvent('[SMS] '+threads[i].getFirstMessageSubject()+' -from- '+message.getFrom(),
new Date(now+60000), new Date(now+60000), { description:message.getBody() }).addSmsReminder(0);
}
label.removeFromThreads(threads);
}

最佳答案

您可以使用(完全免费的)等服务IFTTT或(有点免费)Zapier在收到符合条件的电子邮件时触发 SMS 操作。

Here是一些将 GMail 连接到 SMS 的 IFTTT“食谱”。

关于gmail - 使用 Google Apps 脚本的 Gmail 短信通知 : how to display content of the email?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14848383/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com