לשלוח תבנית וואטסאפ
שלב
whatsapp-send-templatenotifyהשפעה חיצוניתשולח תבנית ש-Meta אישרה, עם הערכים והכפתורים שלה. אפשר להתחיל בה שיחה בכל זמן.
במבט אחד
| מאפיין | ערך |
|---|---|
| שם השלב | whatsapp-send-template |
| משאב | ClusterStep (lumen.ai/v1alpha1) |
| קבוצה וקטגוריה | notify, messages |
| קרדיטים | 1 קרדיט בכל פעם שהוא מצליח |
| השפעה חיצונית | כן הוא משנה משהו מחוץ ל-Lumen, ולכן ניסיון חוזר שואל קודם, ובדיקה מראה מה הוא היה עושה במקום לעשות את זה. |
| ההתקנה צריכה לספק | כלום |
קלט
| מאפיין | ערך |
|---|---|
| צריך | כלום |
| מפיק | fields |
| עובד על | item מסמך אחד בכל פעם |
״צריך״ ו״מפיק״ הם סוגי נתונים (file, text, fields, email). העורך מציע שלב רק במקום שבו מה שהוא צריך כבר נמצא במסלול. ראו מסמכים ונתונים.
פלט
צומת מאוחר יותר מפנה לפלט כ-{nodeId.field} בטקסט, או כ-nodeId.field בתנאי.
| פלט | סוג |
|---|---|
whatsappMessageId | string |
whatsappStatus | string |
הגדרות
מגדירים תחת config: בצומת של התהליך. הגדרות טקסט יכולות להכיל מצייני מקום כמו {nodeId.field}.
| הגדרה | סוג | ברירת מחדל | תיאור |
|---|---|---|---|
connectorRef | string | - | Send fromminLength 1 |
to | string | - | TomaxLength 200 |
toMember | string | - | Their email. They must have joined this number with their phone (Profile, WhatsApp).maxLength 320 |
templateחובה | string | - | Template is the approved template's name, as Meta has it.minLength 1; maxLength 512 |
languageחובה | string | - | Language is the template's language code, he or en_US.minLength 2; maxLength 15 |
params | list of string | - | Params fill the template's {{1}}, {{2}}, ... in order; each may hold placeholders.maxItems 20 |
buttonPayloads | list of string | - | ButtonPayloads are what the template's quick reply buttons send back when tapped, by position; each may hold placeholders.maxItems 10 |
ה-JSON Schema המלא של ההגדרות: whatsapp-send-template.schema.json.
דוגמה
config
buttonPayloads:
- approve:{number}
- reject:{number}
connectorRef: whatsapp-main
language: he
params:
- '{number}'
- '{amount}'
template: receipt_ready
to: '{phone}'
שימוש בתהליך
צומת שמריץ את whatsapp-send-template נכנס תחת spec.nodes של Flow. תנו לו כל מזהה, ורשמו ב-next את מזהי הצמתים הבאים.
flow.yaml (spec.nodes)
- id: whatsapp-send-template
stepRef: {name: whatsapp-send-template}
config:
buttonPayloads:
- approve:{number}
- reject:{number}
connectorRef: whatsapp-main
language: he
params:
- '{number}'
- '{amount}'
template: receipt_ready
to: '{phone}'
הדף עזר לכם?