メインコンテンツまでスキップ

WhatsApp & SMS通知

注文イベント、放棄されたカートなどに対してWhatsAppまたはSMS通知を送信します。


概要

流れ:

  1. 管理者がSettingsでゲートウェイURLを設定します。
  2. 管理者がProducts → Notifications(または類似)で通知テンプレートを作成します。
  3. トリガーが発火すると(例:注文完了、請求書支払い、放棄されたカート)、モジュールがゲートウェイにリクエストを送信します。
  4. ゲートウェイがWhatsAppまたはSMSでメッセージを配信します。

設定

ゲートウェイURL

  1. Setup → Settings → Productsに移動します。
  2. WhatsApp / SMS Notificationsの下で:
    • 機能を有効にします。
    • SMS Gateway URLを入力します - SMSプロバイダーのwebhook/APIエンドポイント。
    • WhatsApp Gateway URLを入力します - WhatsAppプロバイダーのwebhook/APIエンドポイント。
  3. 保存します。

テンプレートごとのオーバーライド

各通知テンプレートはグローバルゲートウェイまたはカスタムwebhook URLを使用できます。


通知テンプレートの作成

  1. Products → Notifications(またはProduct Notifications)に移動します。
  2. New Notificationをクリックします。
  3. 以下を設定します:
FieldDescription
NameInternal name
ChannelWhatsApp or SMS
Triggerabandoned_cart, order_placed, order_paid
Recipientclient or staff
Message templateText with merge fields
Webhook URLOverride global (optional)
Webhook methodPOST or GET
Webhook bodyJSON template for the API
  1. 保存します。

マージフィールド

メッセージテンプレートで以下のプレースホルダーを使用します:

FieldDescription
{companyname}Your company name
{cart_link}Link to checkout
{cart_total}Cart total (abandoned cart)
{client_name}Customer name
{contact_phonenumber}Phone number
{order_id}Order ID
{order_date}Order date
{total}Order total
{invoice_number}Invoice number
{invoice_link}Link to invoice

トリガーイベント

  • abandoned_cart - cronが放棄されたカートリマインダーを送信するとき。
  • order_placed - 注文/請求書が作成されたとき。
  • order_paid - 請求書が支払い済みとしてマークされたとき。

Webhook Body

デフォルトのボディ形式は通常次のとおりです:

{"to":"{contact_phonenumber}","body":"{message}"}

{message}プレースホルダーはレンダリングされたメッセージ(JSONエンコード)に置き換えられます。ゲートウェイのAPI要件に合わせてボディテンプレートを調整してください。