פעולות בלחיצה אחת

פעולות בלחיצה אחת מאפשרות למשתמשים לבצע פעולות ישירות מתיבת הדואר הנכנס בלי לצאת מ-Gmail. כדי לבצע פעולות בלחיצה אחת, צריך להצהיר על HttpActionHandler עם כתובת ה-URL של השירות. פרטים נוספים זמינים במאמר טיפול בבקשות לפעולות.

לחצן אישור ב-Gmail
פעולות בלחיצה אחת ב-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.