简体   繁体   中英

Pre-populate SMS body via HTML link/URL in email

I am using a custom application to trigger emails and SMS campaigns in pre-deteremined time slots. As per a requirement, I need to send an email containing an link/URL such that, upon clicking that link/URL the default SMS app of the phone opens with the body text and number pre-poppulated.

I went through this , and created the following URL:

<a href='sms:54321;?&body=HELLO'>Click here</a>

I put this in a HTML file, and sent it across an email attachment. It worked fine on Android as well as iPhone.

However, when I embed the HTML link in the email itself, it gives problems.

On some email clients like Gmail app (web/mobile) and Outlook mobile app, the "Click here" appears as plain text in the email. Upon inspecting the page on gmail.com, I noticed that the href attribute was missing.

On some other email clients, like Thunderbird on Ubuntu, Edison Mail app on iPhone, the link showed up fine and worked perfectly.

Note: the email recipient is a gmail address.

As the link works fine in some clients, it rules out the possibility of an issue with

  • the email delivery service - sendgrid

  • the recipient's email service provider (gmail)

I replaced & with & follows by amp; in href, but the discrepancy persists.

I am not able to understand the reason for this.

Is there is a way to achieve this functionality, irrespective of the email client in which we open the email?

Note: A mailto is working fine in href,ie, it shows up as a hyperlink, For eg,

<a href='mailto:xyz@example.com'>Click here</a>

As far as I've been able to research, Gmail and Outlook do NOT allow <a href="sms:" links. I haven't directly tested this with Outlook, but with Gmail, the link is stripped of the tag and becomes plain HTML text, like you say. No workaround that I know of.

I realize this isn't ideal , but assuming you are sending this email to someone who primarily uses a smartphone to read emails (otherwise why have the SMS link), you can simply write: "Shoot me a text at 555-555-5555."

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM