- One-Click Action
- Rsvp Action
- Review Action
- Go-To Action
の 4 つがある。
それぞれ受信メール一覧画面にて、当該メールの右のほうに表示される。
ユーザはメールを見ること無しにこのボタンから直接アクションを起こす事が出来る。
Review Action はメール内にも強力な導線があった
それぞれ
- ワンクリックで、Gmail から離脱することなしに自由な HTTP リクエストを発行出来る One-Click Action (e.g. Mail Chimp の Confirm Subscription)
- 「はい」「いいえ」「多分」から返答を選択することが出来る Rsvp Action
- 「星の数」を選択しレビューを書き込む HTTP リクエストをその場で発行出来る Review Action
- 「本文」もオプションで要求する事が出来る
- ボタンから直接指定した URL にジャンプすることの出来る Go-To Action (e.g. Amazon の荷物追跡や注文表示)
- https://script.google.com/ で次のようなスクリプトと HTML を用意
- HTTP リクエストを受ける URL は requestb.in がおすすめ
function myFunction() {
var htmlBody = HtmlService.createHtmlOutputFromFile('review_action').getContent();
MailApp.sendEmail({
to: Session.getActiveUser().getEmail(),
subject: 'Test Email markup - ' + new Date(),
htmlBody: htmlBody,
});
}
<html>
<head>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"action": {
"@type": "ReviewAction",
"name": "レビューする",
"review": {
"@type": "Review",
"itemReviewed": {
"@type": "FoodEstablishment",
"name": "Joe's Diner"
},
"reviewRating": {
"@type": "Rating",
"bestRating": "5",
"worstRating": "1"
}
},
"handler": {
"@type": "HttpActionHandler",
"url": "http://requestb.in/1lyfre61",
"requiredProperty": {
"@type": "Property",
"name": "review.reviewRating.ratingValue"
},
"optionalProperty": {
"@type": "Property",
"name": "review.reviewBody"
},
"method": "http://schema.org/HttpRequestMethod/POST"
}
},
"description": "We hope you enjoyed your meal at Joe's Diner. Please rate your experience."
}
</script>
</head>
<body>
<p>
This a test for a Go-To action in Gmail.
</p>
</body>
</html>
結果
- 文法エラーとかあると表示されない(すごくデバッグしにくい)
- GAS 使うとまあまあデバッグ出来る
- 送信元アドレスによって出来たり出来なかったりする?調査必要。
Action
のname
を弄るとボタンのラベルが変わったりするGo-To Action
のみ検証- One-Click Action のクリックは一度のみ
- Go-To Action と One-Click Action は
name
で名前を変えられる - Review Action は
name
で名前を変えられない。星のみだと評価
, 本文を要求するとクチコミ
となる - Review Action では
bestRating
は 5,worstRating
は 1 限定。(要は 5 つ星評価のみ)
なぜか RSVP Action だけ上手く行かない。
公式の JSON-LD 使ってもダメ。