פעולות בלחיצה אחת מאפשרות למשתמשים לבצע פעולות ישירות מתיבת הדואר הנכנס, בלי לצאת מ-Gmail. הפעולות בקליק אחד מתבצעות על ידי הצהרה על HttpActionHandler
עם כתובת ה-URL של השירות. פרטים נוספים זמינים במאמר טיפול בבקשות פעולה.
פעולות בלחיצה אחת ב-Gmail.
תרחישים לדוגמה
בשלב זה ב-Gmail יש תמיכה בפעולות של לחיצה אחת:
אישור הפעולה
אפשר להוסיף לחצן 'אישור' בלחיצה אחת להודעות אימייל שבהן המשתמשים מתבקשים לאשר, לאשר ולאשר משהו. לאחר שהמשתמש ילחץ על הלחצן, תופק בקשת http מ-Google לשירות שלכם, שמתעד את האישור. אפשר לתקשר עם ConfirmAction
רק פעם אחת.
ההצהרה הבאה מוסיפה לחצן ConfirmAction
לאימייל לגבי דוח הוצאות:
JSON-LD
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ConfirmAction",
"name": "Approve Expense",
"handler": {
"@type": "HttpActionHandler",
"url": "https://myexpenses.com/approve?expenseId=abc123"
}
},
"description": "Approval request for John's $10.13 expense for office supplies"
}
</script>
מיקרו נתונים
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="potentialAction" itemscope itemtype="http://schema.org/ConfirmAction">
<meta itemprop="name" content="Approve Expense"/>
<div itemprop="handler" itemscope itemtype="http://schema.org/HttpActionHandler">
<link itemprop="url" href="https://myexpenses.com/approve?expenseId=abc123"/>
</div>
</div>
<meta itemprop="description" content="Approval request for John's $10.13 expense for office supplies"/>
</div>
שמירת הפעולה
ניתן להשתמש ב-SaveAction
כדי לתאר אינטראקציות כמו שמירת שובר או הוספת שירים לתור ההאזנה. אפשר לתקשר עם SaveAction
רק פעם אחת.
ההצהרה הבאה מוסיפה לחצן SaveAction
לאימייל בנוגע למבצע:
JSON-LD
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "SaveAction",
"name": "Save Offer",
"handler": {
"@type": "HttpActionHandler",
"url": "https://offers-everywhere.com/save?offerId=xyz789"
}
},
"description": "$5 meal at Joe's Diner"
}
</script>
מיקרו נתונים
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="potentialAction" itemscope itemtype="http://schema.org/SaveAction">
<meta itemprop="name" content="Save Offer"/>
<div itemprop="handler" itemscope itemtype="http://schema.org/HttpActionHandler">
<link itemprop="url" href="https://offers-everywhere.com/save?offerId=xyz789"/>
</div>
</div>
<meta itemprop="description" content="$5 meal at Joe's Diner"/>
</div>
בדיקת תגי העיצוב
אפשר לאמת את תגי העיצוב באמצעות הכלי לבדיקת סימון אימיילים. מדביקים את קוד הסימון ולוחצים על הלחצן אימות כדי לסרוק את התוכן ולקבל דוח על השגיאות שנמצאו.
מפרט
לנכסים שזמינים לפעולות האלה, עיינו במסמכים של הסוגים הספציפיים ConfirmAction ו-SaveAction.