To make a clickable button that would open a new windows using your provided link, copy and paste this script to your footer :
<script>
function getMobileOperatingSystem() {
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
if ( userAgent.match( /iPad/i ) || userAgent.match( /iPhone/i ) || userAgent.match( /iPod/i ) ) { return 'iOS'; }
else if ( userAgent.match( /Android/i ) ) { return 'Android'; }
else { return 'unknown'; }
}
var message_text="Pre-filled message goes here"
if (device == 'iOS') {
href = "https://wordpress.stackexchange.com/questions/255610/sms://+15558675309/&body=" + encodeURI(message_text);
} else {
href = "sms://+15558675309/?body=" + encodeURI(message_text);}
document.getElementById("myElement").innerHTML = '<button onclick="window.open(' + href + ');">Click me!</button>';
</script>
Then, create a div
element and set it’s ID to myElement
or anything you want, like :
<div id="myElement"></div>
.
After loading the page, the button will inserted to your div
.