我想从gmail自动创建日历事件。 我命令测试相同我使用URL(https://script.google.com)来测试相同但代码不起作用。 代码如下:
文件名 - Code.js
function testSchemas() {
var htmlBody = HtmlService.createHtmlOutputFromFile('mail_template').getContent();
MailApp.sendEmail({
to: Session.getActiveUser().getEmail(),
subject: 'Test Email - ' + new Date(),
htmlBody: htmlBody,
});
}
文件名 - mail_template.html
<html>
<body>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "EventReservation",
"reservationNumber": "IO12345",
"underName": {
"@type": "Person",
"name": "Rahul Kumar"
},
"reservationFor": {
"@type": "Event",
"name": "Google I/O 2013",
"startDate": "2017-01-05T08:30:00-08:00",
"location": {
"@type": "Place",
"name": "Moscone Center",
"address": {
"@type": "PostalAddress",
"streetAddress": "800 Howard St.",
"addressLocality": "San Francisco",
"addressRegion": "CA",
"postalCode": "94103",
"addressCountry": "US"
}
}
}
}
</script>
<p>
Dear Rahul, thanks for booking your Google I/O ticket with us.
</p>
<p>
BOOKING DETAILS<br/>
Reservation number: IO12345<br/>
Order for: Rahul Kumar<br/>
Event: Google I/O 2013<br/>
Start time: Jan 5th 2017 8:00am PST<br/>
Venue: Moscone Center, 800 Howard St., San Francisco, CA 94103<br/>
</p>
</body>
</html>