74. How to render SMS templates via Apex code with merge fields?

If you are using your own code to send SMS and automate the process and you are also looking forward to using dynamic fields in the SMS text, you would need an additional bunch of code to resolve the merge fields before sending the SMS.

Check the given URL for more details:
https://www.sms-magic.com/technical-resource-center/sms-magic-for-developers/

Important Announcement!

URGENT! Please register the 10-digit business phone number (e.g. 555-555-5555) that your organization uses to send texts to consumers in the U.S. Failure to register may cause heavy penalties and disruption to all your text messaging communications.