为Gmail预设回复创建快捷方式

时间:2016-11-17 02:29:12

标签: gmail gmail-api email-integration email-templates

我目前正在使用Gmail实验室功能 - canned responses.我有很多这些预设回复,并使用their menu找到合适的回复,证明非常耗时。通过以下方式更容易找到预设的响应:

  1. 将预设回复与关键字相关联
  2. 在正文或主题字段中使用该关键字。 Something like this.
  3. 使用Gmail API是否可行,或者您会建议采用其他方法吗?

2 个答案:

答案 0 :(得分:4)

这个工作流程怎么样?添加标签" CannedResponses" 所有准备好的回复。然后用回复适用的特定标签标记每个标签,例如' TestLabel1'。然后,随着新电子邮件的出现,您可以标记它们,然后运行如下脚本:

 
function CannedReply() {
  var label = "<mylabel>"; //eg <myLabel> = TestLabel1
  var myemail = "<me@gmail.com>";

  var responsebody = GmailApp.search(
      "label:" + label + " label:CannedResponses"
      )[0].getMessages()[0].getBody();
  var threads = GmailApp.search("label:" + label + " -label:CannedResponses label:unread");
  for (var i = 0; i < threads.length; i++) {
    for (var j = 0; j < threads[i].getMessageCount(); j++) {
      message = threads[i].getMessages()[j];
      message.reply("", {htmlBody: responsebody, from: myemail});
      GmailApp.markMessageRead(message);
    }
  }
}

答案 1 :(得分:1)

  

在正文或主题字段中使用该关键字

Autohotkey将支持此功能,它是一个应用程序,可让您将组合键或关键字映射到文本宏。您不会以这种方式使用任何本机Gmail功能,包括其罐头响应功能,但它可能非常适合您的需求。