您可以通过 Twilio 发送富文本消息吗? [英] Can you send rich text messages via Twilio?

查看:35
本文介绍了您可以通过 Twilio 发送富文本消息吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过 Twilio 发送富文本消息.我可以发送常规 SMS 消息,但我想在文本正文中包含一个超链接.

I am trying to send a rich text message via Twilio. I am able to send regular SMS messages, but I want to include a hyperlink in the body of the text.

我尝试使用 twilio mediaUrl 来包含一个 rtf 文件,但这没有用.在消息正文中包含 html 不起作用,因为它只是以纯文本形式发送.

I tried the twilio mediaUrl to include an rtf file, but that didn't work. Including html in the body of a message doesn't work as it just sends in plain text.

我通过 curl 发布到 twilio 端点,所以我不想进入 PHP 或其他一些语言来实现这一点.如果可能,我只想将原始数据发送到 twilio 并接收一条富文本消息.

I'm posting via curl to the twilio endpoints, so i'd prefer not to have to get into PHP or some other language to achieve this. I just want to send raw data to twilio and receive a rich text message back, if it's possible.

推荐答案

Twilio 开发人员布道者在这里.

Twilio developer evangelist here.

使用 Twilio,您可以向美国和加拿大的号码发送彩信.当您传递 mediaUrl 时,该文件需要在网络上的某个地方公开托管,然后它将包含在消息中.

Using Twilio you can send MMS messages to numbers in the US and Canada. When you pass a mediaUrl the file needs to be hosted somewhere publicly on the web and it will then be included within the message.

您可以传递任何此处列出的 mime 类型的文件,但在发送 RTF 时,结果将取决于接收设备对 RTF 文件的支持程度.

You can pass files of any of the mime types listed here, though when sending RTF the result will depend on how well the receiving device supports RTF files.

如果您想包含链接,我建议您缩短 URL(使用 bit.ly 或类似方法)并将其作为文本的一部分发送.大多数智能手机会自动链接 URL.手机上的内置 SMS 应用程序不支持任何类型的标记,这就是您尝试使用 HTML 时只显示原始标记的原因.

If you want to include a link, I'd recommend shortening the URL (using bit.ly or similar) and just sending it as part of the text. Most smart phones will auto link the URL. Built in SMS apps on phones don't support markup of any sort, which is why your attempt with HTML just showed the raw markup.

告诉我这是否有帮助.

这篇关于您可以通过 Twilio 发送富文本消息吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆