דלג לתוכן הראשי

לשלוח תבנית וואטסאפ

שלב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 בתנאי.

פלטסוג
whatsappMessageIdstring
whatsappStatusstring

הגדרות​

מגדירים תחת config: בצומת של התהליך. הגדרות טקסט יכולות להכיל מצייני מקום כמו {nodeId.field}.

הגדרהסוגברירת מחדלתיאור
connectorRefstring-Send fromminLength 1
tostring-TomaxLength 200
toMemberstring-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
paramslist of string-Params fill the template's {{1}}, {{2}}, ... in order; each may hold placeholders.maxItems 20
buttonPayloadslist 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}'