Send SMS with an emoji using Twilio webhook, comes through as plain text only? | Community
Skip to main content
New Participant
December 11, 2023
Solved

Send SMS with an emoji using Twilio webhook, comes through as plain text only?

  • December 11, 2023
  • 1 reply
  • 5720 views

Hi all

Does anyone use Twilio for sending SMS messages from Marketo? I have an issue that's stumping me.

We want to send SMS messages that have emojis in them eg 🌼 https://www.compart.com/en/unicode/U+1F33C

We send these messages from Marketo -> Twilio via a webhook. In this webhook are Marketo tokens which is where we configure the content of the message.

This webhook passes the payload to Twilio in plain text, which strips out the emojis. If I try to add them in unicode or HTML formats ( U+1F33C or 🌼), Twilio still treats them as plain text and fails to send them as emojis. So eg an SMS saying "Here is a flower 🌼" turns into "Here is a flower U+1F33C". 

I can't tell if this is an issue with how Marketo sends the information or how Twilio is receiving it. I've lodged tickets with both platforms but hoping someone has come across this before?

Best answer by SanfordWhiteman

The format “U+1F33C” is not an encoding. It’s the way we discuss Unicode codepoints specifically independent of any encoding.

 

HTML encoding doesn’t make sense here because you aren’t sending HTML.

 

Twilio’s Message resource expects a URL-encoded (i.e. percent-encoded) payload.

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
December 11, 2023

The format “U+1F33C” is not an encoding. It’s the way we discuss Unicode codepoints specifically independent of any encoding.

 

HTML encoding doesn’t make sense here because you aren’t sending HTML.

 

Twilio’s Message resource expects a URL-encoded (i.e. percent-encoded) payload.

New Participant
December 13, 2023

Thanks @sanfordwhiteman. I'm not familiar with percent encoding, what do I need to do to send an emoji in a Marketo token to Twilio using their webhook?

SanfordWhiteman
New Participant
December 13, 2023

If you set the webhook to use Form/Url request encoding, Marketo automatically URL-encodes any tokens.

 

Please show the config of your webhook and the tokens on the Tokens tab.