将标签添加到电子邮件文件会产生错误
我创建了一个脚本,如果他们不包含“ a”标签,并将消息的内容发送到我称为“ ssfunction”的函数,然后将“ ssfunction”的函数发送到它 这是我制作的脚本:
const threads = GmailApp.search('-{label:a}');
for (const thread of threads) {
const messages = thread.getMessages();
const minuteAgo = new Date(Date.now() - 60000);
if (thread.getLastMessageDate() > minuteAgo) {
for (const message of messages) {
if (message.getDate() > minuteAgo) {
const result = ssfunction(message);
didUpload = result || didUpload;
}
}
thread.addLabel("a");
} else {
const result = ssfunction(messages[messages.length - 1]);
didUpload = result || didUpload;
thread.addeLabel("a");
}
但是我有一个错误: typeerror:thread.addelabel不是函数
非常感谢您提供帮助
I created a script that receives last minute emails if they do not contain a "a" tag and sends the content of the message to a function I called "ssfunction" and then adds the "a" tag to it
And this is the script I made:
const threads = GmailApp.search('-{label:a}');
for (const thread of threads) {
const messages = thread.getMessages();
const minuteAgo = new Date(Date.now() - 60000);
if (thread.getLastMessageDate() > minuteAgo) {
for (const message of messages) {
if (message.getDate() > minuteAgo) {
const result = ssfunction(message);
didUpload = result || didUpload;
}
}
thread.addLabel("a");
} else {
const result = ssfunction(messages[messages.length - 1]);
didUpload = result || didUpload;
thread.addeLabel("a");
}
But I get such an error:TypeError: thread.addeLabel is not a function
Thank you so much for all the willingness to help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的脚本中,我认为
Addelabel
的方法名称必须修改为addlabel
。我认为这是您错误消息的原因。而且,在addlabel
的情况下,该参数是gmaillabel对象。当这些要点反映在您的脚本中时,如下所示。来自:
到:
refernce:
In your script, I thought that the method name of
addeLabel
is required to be modified toaddLabel
. I think that this is the reason of your error message. And, in the case ofaddLabel
, the argument is GmailLabel object. When these points are reflected in your script, it becomes as follows.From:
To:
Refernce: