跳转到内容

SMS (Twilio)

Twilio events provider 支持通过 Twilio API 发送 SMS 消息。

answers.json
{
"events-sms-twilio": {
"enabled": true,
"account_sid": "ACxxx...",
"auth_token": "xxx...",
"from_number": "+1234567890"
}
}
选项必需描述
enabled启用/禁用 provider
account_sidTwilio Account SID
auth_tokenTwilio Auth Token
from_number发件号码(E.164 格式)
- 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

配置一个 Twilio webhook 来接收传入的 SMS:

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