CustomerIO 我可以在每个 API 请求中指定 SMS 文本吗?

问题描述

我在 Rails 项目中使用 CustomerIO,需要此功能向能够指定文本正文的用户发送 SMS。

如何指定要发送给 CustomerIO 的 SMS 文本?在 docs 中,我只能找到如何设置带有预定义文本正文和一些 Liquid sugar 的广告系列。

解决方法

关于使用 Liquid 模板语言的文档,您走在正确的道路上。假设您已使用 Twilio 集成配置您的 Customer.io 帐户以发送 SMS 消息,那么只需创建一个具有 SMS 消息操作的活动,该活动从您通过 API 发送的数据中提取您的自定义文本。

基本上,如果您使用官方 customerio-ruby gem,您希望在事件中发送您希望在消息正文中使用的数据。像这样:

a

因此,在 Customer.io 中,每次接收到名为 # Arguments # customer_id (required) - the id of the customer who you want to associate with the event. # name (required) - the name of the event you want to track. # attributes (optional) - any related information you'd like to attach to this # event. $customerio.track(5,"sendsms",:msg => "This is the custom message body") 的事件时,您的事件触发广告系列都应触发,您可以为 SMS 操作的内容设置此项:

sendsms

这样,每次将事件发送到 API 时,此活动都会针对发送事件的用户 ID 触发,并且在 API 调用的 {{ event.msg }} 属性中传递的任何数据都将通过 {{ 1}} 液体标签。

这只是使用 API 中的动态数据发送 SMS 消息的一种方式,主要是一对一操作,因为您需要为每个要发送消息的用户 ID 发送一个 API 调用。还有其他机制,例如,如果您想要进行一对多消息传递,其中单个 API 调用会触发许多 SMS 消息发送给您想要查看 API Triggered Broadcast campaigns 的许多用户。>