我正在将 Twilio 的
WhatsApp template
迁移到他们的 Content Builder
,并将所有模板移至内容模板。我无法接收号召性用语按钮。
例如,这是我的内容
模板 ID:
HX5fc0f957dc40af96ce9ef7055a2c7b22
包含以下模板详细信息
You entered: {{1}}
Do you confirm?
和身体:
You entered: 789660****3871
Do you confirm?`
我在遵循此doc
后使用以下代码await twilioClient.messages.create({
contentSid: "HX5fc0f957dc40af96ce9ef7055a2c7b22",
body: messageBody,
from: TWILIO_PHONE_NUMBER,
contentVariables: JSON.stringify({
1: '789660****3871'
}),
to: to,
});
在日志中,我看到:
## Warning - 12200 ### Schema validation warning The provided XML does not conform to the Twilio Markup XML schema. Please refer to the specific error and correct the problem.
我无法理解我在这里做错了什么。我还发送了
contentSid
和 contentVariables
,这两个都是以前不需要的。
有任何提示或可能的解决方案吗?
我相信您可能会因为对 Content API 功能的误解而面临困难。值得注意的是,Content API 不支持
body
参数。
这可能是无法发送消息的原因。另请注意,使用 Content API 时,您需要指定消息服务作为发件人(请参阅“开始之前”部分)。
await twilioClient.messages.create({
contentSid: "HX5fc0f957dc40af96ce9ef7055a2c7b22",
from: TWILIO_MESSAGING_SERVICE_SID,
contentVariables: JSON.stringify({
1: '789660****3871'
}),
to: to,
});