Skip to main content
How to Use Custom Triggers

Learn how to personalize & send text messages using a webhook

David Stupek avatar
Written by David Stupek
Updated over a week ago

Custom Triggers

Don’t see your CRM or marketing automation software integrated with Salesmsg?

Not to worry. With Salesmsg Custom Triggers, if your CRM has the ability to fire a webhook then you can easily send texts with Salesmsg.

You'll only use Custom Triggers when you have your own application and want to fire texts from a webhook or integrate Salesmsg into your CRM that doesn't natively integrate with Salesmsg, like Ontraport.

How to Create Your Custom SMS Trigger

Note: if you are planning to use Custom Trigger in a POST request specifying more parameters click here to skip to apropriate section.

Step 1: Create a Trigger

From the triggers page, click Create Trigger and this modal will appear.

Name
This is the internal name for your Trigger.

Track Conversion

Alows you yo specify which conversion to track with your trigger.

Integration
This is the list of integrated platforms with Salesmsg. For this example, you can select Custom.

Send As

This is the phone number that the text message will be sent as.

Tags

Add an existing tag in this field. When the contact is sent the Trigger message the tag will automatically be applied to the contact.

Text Message

The body of your message. This can include merge fields.

Ringless voicemail

Audio file to be sent to contact's voicemail inbox.

Step 2: Create Your SMS

With Salesmsg, you can insert custom merge fields by wrapping them in a bracket like { date }. As long as you wrap the word in a bracket, then Salesmsg will recognize it as a dynamic merge field and add it to the webhook URL. You can also add media files to make your message more creative. Click a 📎 button and you'll see a media library where you can choose, upload or even register your media files.

For example, your text could be...

Hi { first_name }, your appointment is on { date } at { time }.

Where { date } and { time } are custom merge fields.

How to Create Fallbacks

When creating your SMS Trigger, you can add fallback merge fields if the data isn't available.

To create a fallback, use the following syntax...

{ data | 'replace' }

For example, if the first name wasn't available you wanted to fallback and insert something else. It would look like this...

Hi { first_name | 'there' }, how are you?

So if the first name was Mike it would show as "Hi Mike, how are you?", but if there wasn't a first name, then it would show as "Hi there, how are you?"

Step 3: Copy Your Trigger URL

After you create your Custom Trigger, copy the Trigger URL and it will display something like this...

https://qa.salesmessage.com/webhook/salesmessage/9d1d7b928c189ce5fa98950644ea3462?phone=&first=&last=&email=&from_id=&message=&media_url[]=&tag_ids[]=

Now from your CRM or other software, you can insert the proper merge fields into this URL to send the text message.

  • phone (required): The recipient's phone number.

  • first (optional): The contact's first name, recorded in the Contact record in Salesmsg.

  • last (optional): The contact's last name, recorded in the Contact record in Salesmsg.

  • email (optional): The contact's email, recorded in the Contact record in Salesmsg.

  • from_id (optional): Specifies the Salesmsg inbox from which the message is sent.

  • message (optional): Customizes the message body.

  • media_url[] (optional): Includes media, converting the SMS to an MMS.

  • tag_id[] (optional): Tags the contact with a specified tag post-message.

  • value (optional): Specifies custom fields within your message body, such as {date} and {time}.

From your application, you would insert the fields you want into the URL like so:

https://qa.salesmessage.com/webhook/salesmessage/9b5d7b928c189ce5fa98950644ea3462?phone=(561) 778-7787&first=Mike&last=Jones&[email protected]&from_id=&message=&media_url[]=&tag_ids[]=&date=December 5&time=12:00PM

This trigger can be used as GET request.

Using Custom Trigger as POST request

When encountering the character limit of a GET request, which is capped at 2,048 characters, you can opt for a POST request to send the same trigger using any software. Below is a reformatted example demonstrating how to structure a trigger in the POST request format:

Post: https://app.salesmessage.com/webhook/salesmessage/9b5d7b928c189ce5fa98950644ea3462 
{
"phone": (561) 778-7787,
"first": "Mike",
"last": "Jones",
"email": "[email protected]",
"from_id":,
"message";,
"media_url": [],
"tag_ids": [],
"date": "December 5",
"time": "12:00 PM"
}

Key Points for Ensuring Accurate Message Dispatch from the Correct Inbox:

  • Default Parameters: In the absence of specified optional parameters, Salesmsg will default to the settings configured within the trigger itself.

  • String Formatting: Ensure all string values, including dates and times, are enclosed in quotes. For example, "date": "December 5" and "time": "12:00 PM".

  • Media URLs: When including multiple URLs in "media_url", list each as a string within the array, separated by commas, like so: "media_url": ["url1", "url2"].

  • Inbox ID (from_id): Utilize the Inbox ID found within the URL of the specific inbox settings for the "from_id" field.

  • Tag IDs: For "tag_ids", input the ID of the desired tag found in the tag's specific URL. To include multiple tags, separate their IDs with commas.

Step 4 (optional): Test Your Trigger

Use the "Test Trigger" option found at the bottom of the setup modal to send test messages without the need to call the URL or use any API test software. Specify "Test Phone Number"—recipient's number. For testing custom triggers, you can specify additional parameters to check how they work as well.

Who Would Use Custom Triggers?

Custom Triggers are built for users that have other CRM or marketing automation tools that can send outbound Webhooks. For example, Ontraport is a CRM that Salesmsg doesn't directly integrate with, but Ontraport does provide their users with a way to ping a webhook.

If you were an Ontraport user, you would use Custom Triggers to send SMS texts.


Frequently Asked Questions

My merge field or fall back is not working?

Double-check the property your pointing to "&email={email} " does in fact have a value.

Everything seemed to work, only the message was never sent?

This is a strong indication that the phone property is not working. Be sure to use a valid US/CA number & that there is a number in the property your targeting.


Related Articles


Need Help? ✋🏻

Contact us on live chat or send an email to us at [email protected].

Did this answer your question?