Can you send rich text messages via Twilio?

人走茶凉 提交于 2021-02-08 04:45:25

问题


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.

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.

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.


回答1:


Twilio developer evangelist here.

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.

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.

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.

Let me know if this helps at all.



来源:https://stackoverflow.com/questions/33283558/can-you-send-rich-text-messages-via-twilio

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!