How to send Trigger events daily, excluding weekends
This scenario will be useful if the user needs to receive a broadcast with Trigger event every working day, except for weekends - Saturday and Sunday.
1. On Start screen, add a tag with the name "Lesson".
When testing this case, it is recommended to delete the existing tag, as well as clear all user variables before adding a tag to the component. Due to this, when the bot is restarted, the user will be perceived as a new one.
No messages will be sent to the user on Start Screen, and there are also no transitions to other screens, since the rest of the scenario will be carried out with Trigger Event.
Start screen should look something like this:
2. Add the Day of the week check screen. At the last stage, we will add this screen to the Trigger Event settings, and now we are going to deal with its design.
- Delete and re-assign tag. If user tag are updated by deleting the old tag and assigning a new tag to the next component, Trigger event will be triggered as many times as tag will be re- assigned. Therefore, in this case, the tag is deleted every time before a new assignment.
- Let's add Assign a variable. In the value of the dn variable, write a helper to determine the ordinal number of the day of the week:
{{formatDate "d"}}
^[1-5]$
3. Set up the " The fork of the day" screen:
- Add the day variable with the {{day}} value. We will check this variable further in Fork. The serial number of the screens or lessons to be sent will be recorded in day.
- Let's add day to the field for the variable, where the fork will take the value.
- The number of goals corresponds to the number of lessons. In our example, there are 10 lessons, so we will create 9 goals and one Default goal for the first day, because on the first day of the broadcast, the user does not have a verifiable variable.
In Goal 1, there should be the value 1 and transition to the screen with the second lesson, in Goal 2, there should be the value 2 and transition to the screen with the third lesson, in Goal 3, there should be the value 3 and transition to the screen with the fourth lesson, etc.
4. Create 10 screens according to the number of lessons. We will assign a variable to each screen with a value that corresponds to the lesson number. In addition, the text, which will be sent to the user on each of the working days, will be added to each of these screens.
5. Design the screen for the final broadcast separately. On this screen, we delete all user variables and tag. This is necessary so that after sending the last lesson, the Trigger event will no longer be triggered and lessons will not be sent.
6. Create Trigger event that will be sent daily at 9 am. However, if you need to change the time, you can specify the desired time to send.
To the beginning ↑