Custom Fields in SMS Copy

Custom fields allow you to add dynamic information into your sms message copy. For those familiar with the mail-merge concept in email, this should seem very familiar. Coordination is necessary between campaign set up and API requests to ensure that templated fields are defined and passed through appropriately. Setting this up correctly will enable your campaign to feel more personalized than Tape’s simply default use of the provided name field.

Campaign Setup – Template Definition

Defining template variables requires an additional key in the JSON body of your API request to Tape. The new key `template` expects an object representing the key/value pairs (string: string) of the variables you plan to pass through.

See the example below of a full JSON request body that includes template variables.

{
  "mobileNumber": "+12015551234",
  "name": "Dave Schatz",
  "campaignId": "CTV1XXXXXXXXXXX",
  "template": {
      "name": "Dave",
      "petName": "Cleo's"
  }
}

SMS Message Formatting

To use templated variables in your sms message copy, you must reference them with double curly brackets (i.e. {{variableName}}). 

If you include variables in your sms message, Tape will follow your full template and will not prepend your message with “Hi {{name}}!” It is your responsibility to specify a greeting in your message. Since you will only have access to your own pre-defined variables, you must pass the name through your template variables if you want access to it.

See how the example below utilizes the custom fields defined from the previous step:

Hey {{name}}, {{petName}} NomNomNow meals are almost here! Tap the link for tips on transitioning to a fresh diet. Happy nomming

Getting Started

As always, test your requests before going live to ensure custom fields are properly defined and passed through requests.