Getting started
iMessage link button
A link that opens Messages with your number in the To field and a sentence already typed. The customer taps send. That is the whole mechanism — no SDK, no script, one anchor tag.
Why you want them to text first
Two things happen the moment a customer sends you the first message, and both of them matter more than the button itself.
You can reply as much as the conversation needs. An inbound message opens a conversation the customer started. Replying inside one is not outreach, and is not rate limited the way a cold first message to a stranger is. The whole shape of a healthy line is: they start it, you answer it.
Your number is now in their phone. A thread they began sits in their Messages list with everything else they care about. Your next message arrives in a conversation they recognise instead of as an unknown number — which is the difference between being read and being reported.
The link
Your number in E.164, then the message you want typed for them.
<a href="sms:+16465550142?&body=Hi%2C%20I%27d%20like%20to%20book%20a%20quote">
Text us
</a>The ?& is not a typo
Android follows RFC 5724 and expects ?body=. iOS has always expected &body=. Writing ?&body= satisfies both: Android reads the ? and an empty first parameter, iOS reads the &.
It is a convention rather than a standard, and it is the one that works on the two platforms your customers actually hold. Pick either official form instead and the prefilled text silently vanishes for half of them — silently being the problem, since the link still opens and still looks like it worked.
Encoding the body
Run it through encodeURIComponent. An apostrophe, an ampersand or a line break left raw will truncate the message at that character or break the link outright.
const number = "+16465550142";
const text = "Hi, I'd like to book a quote";
const href = `sms:${number}?&body=${encodeURIComponent(text)}`;Where it will not work
Desktop Windows and Linux browsers have no handler for sms: and do nothing at all — no error, no dialog. In-app browsers inside X, Instagram and TikTok may refuse the hand-off to Messages even on a phone that would otherwise manage it.
So show the number as text beside the button, not only inside it. A customer on a laptop can still read it and pick up their phone; a customer whose tap did nothing has something to fall back on. It costs one line and it is the difference between a dead button and a slightly slower path.
<a href="sms:+16465550142?&body=Hi%2C%20I%27d%20like%20to%20book%20a%20quote">
Text us
</a>
<p>or text <a href="tel:+16465550142">(646) 555-0142</a></p>Apple's position on the body
Apple's archived URL scheme reference says an sms: URL must not include a body. Every shipping version of iOS has honoured one anyway, and the whole industry depends on it. Treat it as stable in practice rather than guaranteed: the link must still be worth tapping if the text never appears, which is another reason the button says Text us rather than Send this message.
Generating one
The console builds the link for any number on your project, with the body already encoded and the markup ready to paste — open a project and go to Numbers.
NextReceiving messagesWhat arrives when they tap send, and how to be told about it.