A macro is a special string inside a text block that is replaced with the required data when sent:
- the value of one of the fields in the subscriber's profile (for example, the name or value of a custom field);
- relative date (current date or current date + X days);
- global variables;
- individual links for the operation of a particular integration (for example, automation of payment acceptance).
The constructions look like this: {%first_name%}
The field name or date parameters are written in curly brackets.
Example:
The macro {%first_name%} will automatically be replaced with the subscriber's name inside the message.
(!) Macros will work in URL buttons. They are defined by BotHelp, the necessary data is substituted in their place, then the link will be shortened and will look like https://s.bothelp.io/xxxxxx
(!) You cannot use macros inside shortened links from third-party services. In this case, BotHelp will not be able to find the macro and substitute text in its place.
Where to find macros?
In all text blocks, macros are located in the menu <…>.
Field as a macro
Any field can be used as a macro. To do this, select the desired field from the list of macros. The field value will be inserted into the text without changes.
Use cases:
— to address a subscriber by name, use the “Name” field macro;
- to display the quiz results, use the macro of the "Points" field in which you did the calculation.
Macros in button names in bots
You can use macros in the name of the inline button in the bot:
- the value of one of the fields in the subscriber's profile. For example, the name or value of a custom field;
- relative date (current date or current date + X days);
- global variables.
You can use several macros at the same time in the name of one button, as well as manually entered text. All characters that exceed the limit will be closed with ellipses.
Important! If a subscriber is sent a button with an empty field macro, errors may occur.
Such a button will not be sent in telegram bots, the button and other card elements will not be sent in VK bots. Such buttons will not work in bots of other channels.
If you are afraid that you can accidentally send an empty macro, then add any symbol/emoji to the button name.
The macro in the button name can be selected and inserted using the <…> in the field where you need to enter the button name.
Random Number Generator
The macro substitutes a random number from the range specified in brackets.
Macro format: {?random_num(0,99)?}
A random number from 0 to 99 will be returned instead.
- Available only for Numeric fields .
- The range can be set to any value.
- Can be used in mathematical operations.
- Can be inserted simply into text messages.
For example, you want to give a random discount from 10% to 50%.
Then the macro will look like this: {?random_num(10,50)?}
Payment macro
When you create a payment automation , it is assigned a specific macro. Inside the text, it is displayed as {%payment_x%}, and after sending, a link is formed in the message text that leads to the payment landing page.
To add a payment macro, select it from the list. The subscriber will receive a message with a link to the payment landing page.
UTM tag macros
Macros store the data that was transferred in the link when subscribing, namely all UTM tags. You can add one tag ?{%utm_source%} to the link leading to your site or all at once using the macro ?{%ref%}.
Later, you can track these tags on your site and conduct analysis.
Relative Date Macro
This macro allows you not to specify the exact date, but to set a value that will be substituted on the landing page or in the message. The date is calculated from today.
An example of a date macro is {%today+1 (d F)%}. For more information on using them, see the article: Relative Date ↗ .
Time Sharing Macro
There is a specific macro for landings that will show different content depending on the time when the subscriber visited the landing. Macro example: {%split 18:00 today (d F) | today+1 (d F)%}. Learn more ↗
If you have not found the answer to your question, ask us in the chat inside your account or write to BotHelpSupportBot or to hello@bothelp.io
Get 14 days of full functionality of the platform for creating mailings, autofunnels and chatbots BotHelp.