Can you send rich text messages via 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.
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.

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.

Related

What is filename for SMS-sent images processed by Twilio?

When I send an SMS to my Twilio number which includes an image, there doesn't appear to be a filename associated with the image.
I'm using Twilio Studio.
Example:
Send an SMS text with image to my Twilio number
A Twilio Studio Flow pipes the {{trigger.message.MediaUrl0}} and sends an SMS text sent to my actual phone number
The URL is of the following format https://api.twilio.com/2010-04-01/Accounts/<long-GUID-1>/Messages/<long-GUID-2>/Media/<long-GUID-3>
Clicking on this URL opens a browser pointing to a translated URL https://s3-external-1.amazonaws.com/media.twiliocdn.com/<long-GUID-1>/<long-GUID-4> and showing the original image
But no filename.
I'm trying to access the filename so I can apply a naming convention to it. How is this accessed?
The URL to download the actual media is dynamically generated.
You can refer to the blog post here:
Retrieving Twilio MMS Image URLs with Node.js

Can we send file as an attachment along with message in teams programmatically?

Can we send file as an attachment along with message in teams using webhooks or api?
Currently we can send only text message using webhooks and not attach files.
I want to mimic the action in the screenshot below:-
Attach file present in the system
There are ways to first upload file to one drive and then send its link in the teams message but I do not want to use that solution.
Is there a way to directly upload file from your system as an attachment to the microsoft teams using webhook or any alternative way.
Thanks!!
Currently it is not supported to send attachments using webhook. You will need to use bot to send and receive attachments. You can refer this link.
https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/bots-filesv4

Can I use custom JSON format for incoming webhooks

I have a JSON payload that is being sent to Slack using the URL provided by Slack when installing the Incoming Webhook app.
The JSON payload is not in the expected format by slack.
I would like to write an app (or find a way) that receives this JSON phrase it to the correct format and then displays it on the configured slack Channel.
See example below:
if i send the following JSON
{"message":"Allow me to reintroduce myself!"}.
This will not work. we need to change "message" to "text".
So my json payload is not within the needed format, however it is still a json.
How can i catch the json payload? and parse it ?
i would like to do this all on slack with no third party or "middle man" apps.
Is that possible ?
No.
Slack does not provide a custom format for incoming webhooks. You need to adhere to the official format.
There also is no way to intercept the message and transform it to the Slack format.
The only way to achieve this is to use a "middle man" app for the transform:
Message is send to middle man app's URL
Middle man app transforms to Slack format
Middle man sends message to Slack

Markdown is not working in the Bot Framework Twilio channel

I am trying to create a simple bot that sends images and hyperlinks by SMS using Twilio (trial account).
I do get the reply from the bot , but none of the markdown is working, even simple markdown elements like text or bing
Sample code I am using to send the message through Twilio SMS channel:
public async Task<Message> Post([FromBody]Message message)
{
if(message.Text == "Hello")
{
string messageText = "![Sample Image](http://aka.ms/Fo983c)";
return message.CreateReplyMessage(messageText);
}
Am I missing something? The emulator displays the image and other markdown properly, but when I test using my android phone and text the Twilio number to connect to the bot, it delivers raw HTML and not the rich content.
Twilio developer evangelist here. As pointed our earlier SMS is text only, so markdown or any other formatting will not work.
I just tried sending a message from a bot, and while I get the image correctly on the emulator or webchat, on SMS I only get the URL of the image (i.e. http://aka.ms/Fo983c).
According to the documentation, this is the expected behavior as it states:
Not all channels can represent all markdown fields. As appropriate
channels will fallback to a reasonable approximation, for example,
bold will be represented in text messaging as bold
So I guess for images, it will always fallback to the URL of the image.
As for sending MMS, it appears right now the botframework doesn't support it. To be clear, Twilio itself does support MMS for US and Canada, but it seems Microsoft's implementation didn't take advantage of that right now.
Hope this helps you.
I did this when I was first trying out the framework. Sorry but I don't have that code anymore however I don't recall having to do anything special. I simply sent a picture from my phone to my twilio number and then in the message properties for the message received by the bot there was an attachment field with a URL pointing to the image sent from my phone. Then I used a regular web request to pull down the image.
The details for the attachment objects and content url fields are outlined here.
Because there's no way to emulate the SMS channel you'll have to publish the code live to be able to test it out.
Have fun!

Incorrect HTML formatting when sending email from PowerShell to Lotus Notes user

I am trying to send a report from Exchange Management Shell Exchange 2007. When I send this report to Outlook the email is formatting as expected, but when I send the email to Lotus it's losing the HTML formatting such as CSS, headings, tables and borders. The data is preserved but the formatting is incorrect.
On the other hand, when I send the message using Send-MailMessage in Exchange 2010 everything is fine even when I send it to a Lotus Notes user.
Why does this difference occur?
You're going to have to go to the Notes client, and view the MIME source of both messages and compare them using a good diff program. If one is displaying correctly, and the other is not, there will be differences, and finding out why and those differences occur should give you some clue about what is happening to break the message.
(The above is assuming that the recipient is set up to receive the message in his mailbox in MIME format. If, in fact, the user has been set up to receive messages converted to Notes rich text format, then you would have to go to the Domino server instead of the Notes client, and use the SMTPSaveImportErors setting to capture the MIME source for the two messages.)

Resources