Action: Broadcast¶
This action allows you to send mass messages to all users of your bot, based on the conditions you set.
You can customize messages according to the user's language or other variables, and send different messages depending on whether they meet certain conditions.
If a user does not meet any condition, they will not receive any message, and the next user will be evaluated.
How does this action work?¶
- Message conditions are evaluated from top to bottom.
- The first message whose condition is met for a user will be sent.
- If no condition is met, that user will not receive any message.
- You can send messages to all users or a random number of users, depending on your configuration.
Important information
- Cost: Every time you use this action, it consumes 5 executions and broadcast resources.
-
Broadcast resources:
- They renew every month according to your plan and can be increased by upgrading your subscription.
- With the premium subscription, you will have unlimited broadcast resources and executions. See all the benefits of the premium subscription here.
-
You can purchase additional broadcast packages that do not expire. Go to:
VisualMaker →
🖥 Bots
→📜 My bots
→ (select your bot) →📦 Extra packages
→Broadcast 📧
-
Sending speed: Depends on your subscription plan.
- Cancel active broadcast: Send the command
/stop_broadcast
How to configure the action?¶
1. Create the action¶
- Go to your bot and enter the editor by pressing
🛠 Edit
. - Select the button or command where you want to add this action, or create a new one.
- Go to
Actions 🌟
→🎯 New action
→📧 Broadcast
. - Press
Configure 🛠
to set it up.
2. Configure the options¶
➡️ View messages
¶
- Here you can view, add, and edit the messages you want to send.
- Set a condition (in expression format) for each message. If the condition is met, that message will be sent to the user; otherwise, the next message’s condition will be evaluated. If no condition is set, the message will always be sent.
➡️ Users
(optional)¶
- Define the number of random users who will receive the broadcast.
- If you do not set a number, the message will be sent to all users.
- You can use expressions, variables, or action IDs to customize the number of users.
3. Activate the action¶
Press ✅ Activate
to activate this action and make it functional.
What does this action return through its ID?¶
It does not return anything.
Practical example: Broadcast in Spanish or English based on user language¶
In this example, we will use the Broadcast
action to send a message in Spanish to users who speak Spanish. The rest will receive a message in English.
1. Create the Broadcast
button¶
- Enter your bot’s editor by pressing
🛠 Edit
. - Create a new button by pressing
✳️ New button | command
and name itBroadcast
. - Press
Actions 🌟
to configure the button's actions.
2. Configure the actions¶
a) Action 1: Broadcast¶
- Press
🎯 New action
and select📧 Broadcast
. -
Press
Configure 🛠
→✉️ View messages ✉️
:-
Press
➕ New message ➕
to set the Spanish message:-
Press
🗒 Message
→💬 Set message 💬
and enter the message to send:Hola {first_name}, ¿cómo estás?
-
Press
↙️ Back ↘️
, thenCondition 🕹
, and enter the condition:{language_code == "es"}
-
-
Press
➕ New message ➕
to set the English message:- Press
🗒 Message
→💬 Set message 💬
and enter the message to send:Hello {first_name}, how are you?
Note 1: It's not necessary to set a condition here, so this message will be sent to all users who do not speak Spanish.
Note 2: Both
first_name
andlanguage_code
are native variables. See all of them here. - Press
-
-
Return to the actions menu and press
✅ Activate
to activate this action.
Final result¶
- The user presses the
Broadcast
button, triggering the broadcast action. - The bot evaluates the conditions for each message:
- If the user’s language is
es
, the Spanish message is sent. - If the user's language is anything else, the English message is sent.
- If the user’s language is
- The process continues evaluating the next users until the broadcast is complete.