我有一个气体脚本,发送自动电子邮件,并希望包括几个表情符号。我尝试过使用快捷码和复制/粘贴,但到目前为止似乎都不起作用。只是想看看我是不是遗漏了什么。
编辑:代码如下:
var title = rowData.publicationTitle;
var journal = rowData.journalTitle;
var url = rowData.publicationUrl;
//Emoji goes here in the body:
var body = "Hi " + firstName + "!<br><br>I noticed your article <a href='" + url + "'>“" + title + "”</a> was recently published in <i>" + journal + "</i>. Congratulations! This is just a friendly reminder to please upload your original document and a PDF version to our publications app when you have time.<br><br>To upload your publication, you can <a href='http://support.cpes.vt.edu/publishing'>click here</a>.<br><br>Thanks!<br><br> CB<br><br><hr style='background-color: #d8d8d8; border: 0 none; color: #d8d8d8; height: 1px;'><span style='font-size:12px'><b>CPES Publications Reminders</b> | <a href='mailto:leshutt@vt.edu' style='text-decoration:none'>Feedback</a> | <a href='http://support.cpes.vt.edu/publishing' style='text-decoration:none;'>Publication uploads</a></span>";
var emailSubject = "Just a reminder to upload your article!";
var me = Session.getActiveUser().getEmail();
var aliases = GmailApp.getAliases();
if (emailStatus == "Pending" && emailData !== "No emails found") {
GmailApp.sendEmail(email, emailSubject, body, {
from: aliases[2],
name: "CPES Bot",
htmlBody: body
});
}
我注意到发送一个星号("⭐")是有效的,但正常的笑脸("")显示为一个黑白的Unicode样式的图标,而我尝试过的其他所有内容都是问号。你只能在某个Unicode版本之前使用表情符号吗?
发布于 2018-06-05 07:48:16
我尝试复制表情符号(https://www.emojicopy.com/)并将其直接粘贴到脚本编辑器中:
在发送电子邮件后,我在邮箱中收到了它:
编辑:
注意,有些表情是一个字符长度(如星号),而另一些是2个字符(如微笑)对于那些有2个字符的表情,你可以在微笑后立即书写,但实际上你是在微笑的内部书写,所以你打破了它,因此变成了问号。
如果您尝试运行此代码,您将看到第一个代码的长度为2,第二个代码的长度为1:
如果你尝试在这两个表情符号上移动指针(在应用程序脚本编辑器中),从表情符号之前到表情符号之后,你会看到在星形表情的情况下只有一步,但对于微笑,你需要两步。
发布于 2019-12-09 09:19:57
也适用于SMS收件人的最简单的完整答案是:
function testNewMail() {
MailApp.sendEmail({
to: "yourphonenumbergoeshere@mymetropcs.com",
subject: "Logos",
htmlBody: " hi todd happy day"
});
}
https://stackoverflow.com/questions/50686254
复制相似问题