コンテンツにスキップ

SMS (Twilio)

Twilio events provider を使うと、Twilio API を通じて SMS message を送信できます。

answers.json
{
"events-sms-twilio": {
"enabled": true,
"account_sid": "ACxxx...",
"auth_token": "xxx...",
"from_number": "+1234567890"
}
}
OptionRequiredDescription
enabledYesprovider を有効/無効にする
account_sidYesTwilio Account SID
auth_tokenYesTwilio Auth Token
from_numberYes送信元 phone number(E.164 format)
- id: send_sms
type: event
config:
provider: events-sms-twilio
action: send
to: "+1987654321"
body: "Your verification code is: {{code}}"
flows/send_notification.ygtc
name: send_notification
version: "1.0"
nodes:
- id: send_alert
type: event
config:
provider: events-sms-twilio
action: send
to: "{{user_phone}}"
body: "Alert: {{alert_message}}"
triggers:
- type: event
event_type: "alert.critical"
target: send_alert

受信 SMS を処理するには、Twilio webhook を設定します。

triggers:
- type: event
event_type: "twilio.sms.incoming"
target: handle_sms