从gmail自动创建日历事件

时间:2017-01-05 05:00:21

标签: google-schemas

我使用下面的代码来安排日历活动,但它无法正常工作。我可以收到电子邮件,但日历活动未自动安排。

mail_tamplate.html

<html>
  <head>
<script type="application/ld+json">
{
  "@context": "http://www.schema.org",
  "@type": "Event",
  "eventStatus": "https://schema.org/ConfirmAction",
  "name": "Rahul Kumar",
  "description": "Desc of event",
  "startDate": "2017-01-05T20:00",
  "endDate": "2017-01-05T21:00",
  "location": {
    "@type": "Place",
    "name": "South Ex",
    "address": {
      "@type": "PostalAddress",
      "streetAddress": "178-C",
      "addressLocality": "Meerut",
      "addressRegion": "Uttar Pradesh",
      "postalCode": "250001",
      "addressCountry": "India"
    }
  }
}
</script>
</head>
  <body>
    <p>
      This a test for a Go-To action in Gmail.
    </p>
  </body>
</html>

code.gs

function testSchemas() {
  var htmlBody = HtmlService.createHtmlOutputFromFile('mail_template').getContent();

  MailApp.sendEmail({
    to: Session.getActiveUser().getEmail(),
    subject: 'Test Email markup - ' + new Date(),
    htmlBody: htmlBody,
  });
}

1 个答案:

答案 0 :(得分:0)

AFAIK,这是不可能的。

  

操作使用户能够在Gmail和收件箱内与您的产品或服务进行互动。

     

例如,当用户收到对活动的邀请时,可以向她呈现从邀请内部以交互方式RSVP的选项。当她收到杂志订阅即将到期的通知时,可能会向她提供从通知中续订的选项。

     

可以通过两种方式声明操作:作为应用内操作或作为Go-To操作。目前支持多种类型的操作。

     

RSVP行动

     
      
  • 可以使用RsvpAction来响应收件箱内的活动邀请。收件箱通过显示事件的详细信息以及发件人定义的是/否/可能响应的组合来呈现此操作。
  •   

enter image description here

在添加事件之前,需要与用户进行交互。 希望这会有所帮助。

相关问题