Is there a way to have a clickable link send an sms on a mobile device, but send an email from a non mobile device? I currently have my link clickable and sending pre populated texts in sms ready for the person to send it. The same link on my desktop is asking to open an app. Just looking for a way to have it distinguish between mobile and desktop and send sms or email.
I've tried function isMobile with true send sms and false send email, but can't seem to get it to work.
function isMobile() {
return preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"]);
}
// Use the function
if(isMobile())
// Do something for only mobile users
else
// Do something for only desktop users`