Skip to main content

Using variables in inbound message triggers

What are inbound message variables?

Inbound message variables let you capture customer information directly from the WhatsApp messages people send you — even if you don't already have their phone number on file.

This is especially useful when you know things about your customers (like their email or first name) but haven't yet collected their WhatsApp number. With variables, you can pre-fill a click-to-WhatsApp link with that information, and when the customer taps it and sends the message, wax automatically saves those details to their contact profile.

When to use it

Use inbound message variables when you want to:

  • Identify customers who message you without needing their phone number in advance

  • Enrich your wax contacts with attributes you already have in another system (email, first name, customer ID, etc.)

  • Personalize your click-to-WhatsApp links so the pre-filled message looks tailored to each customer

How to set it up

When creating an Inbound message trigger, you can include variables anywhere in the trigger message by wrapping them in double curly braces:

Hi, I'm {{first_name}} and my email is {{email}}

When a customer sends a message matching this pattern, wax will:

  1. Recognize the message as a match for your trigger

  2. Extract the values from the variable positions (e.g. their first name and email)

  3. Save those values to the matching contact attributes on the contact

If an attribute referenced in your trigger doesn't exist yet on your organization, wax will create it automatically.

Rules for writing variables

A few simple rules to keep in mind when adding variables to your trigger message:

  • Allowed characters: Variable names can only contain lowercase letters (a–z) and underscores (_). For example, {{first_name}} works, but {{First Name}} or {{firstName}} will not.

  • Separate your variables: Two variables cannot sit directly next to each other. There must be at least one character (a space, punctuation, etc.) between them. For example, {{first_name}} {{email}} is valid, but {{first_name}}{{email}} is not.

  • Duplicate names: If you use the same variable name more than once in the trigger, only the last occurrence will be saved.

  • Variable values: The actual values your customers send can contain any characters, including spaces.

If any of these rules aren't followed, the variable will be treated as regular text and won't be extracted.

How it works end-to-end

  1. You create the trigger with variables like {{first_name}} and {{email}}.

  2. wax generates a click-to-WhatsApp link for the trigger. Each variable is added as a placeholder in the link's URL.

  3. You share the link with your customers — by email, on your website, in an ad, or anywhere else — and personalize each link with the customer's values (their actual first name, email, etc.).

  4. The customer taps the link, which opens WhatsApp with the pre-filled message containing their personal info.

  5. The customer sends the message to your WhatsApp Business number.

  6. wax matches the message to your trigger, extracts the values, and updates the contact's attributes accordingly.

From there, the contact is fully identified in wax and you can target them in flows, campaigns, and segments just like any other contact.

Example

Let's say you want to invite your existing customers (whose emails and first names you have) to chat with you on WhatsApp.

Your inbound message trigger:

Hi, I'm {{first_name}} and my email is {{email}}

The personalized link you send to a customer named Alice:

The click-to-WhatsApp link will open WhatsApp with the message pre-filled as:

Hi, I'm Alice and my email is alice@example.com

When Alice sends that message, wax will save first_name = Alice and email = alice@example.com to her contact profile — no phone number lookup needed.

Did this answer your question?