How to send a message on a specific date

Use this case to send a notification to the user on the date that they specify in advance. For example, this way you can wish a user a happy birthday or notify them of any other important date.

1. Add Message to the screen and ask the user for the date on which they need to send the notification. In this example, we ask for the date of the birthday.

2. Add User Input where this date will be recorded. You can choose any variable name, in the example it is UsDate. Change the data type to Date.

3. Add Assign a Variable. The variable name for today's date, in the example it is nowDate, the value should be {{now}}. That is how we convert today's date into milliseconds.

4. Add another Assign a Variable. The variable name will be the same as in Assign a Variable when we asked the user for the date: UsDate. Add {{formatDate UsDate 'x'}} to Value.

This way we can convert the date from the user into milliseconds.

5. Add the following Assign a Variable. The variable name can be subtractDate, add {{subtract UsDate nowDate}} to Value

That is how we find out the difference between today's date and the date from the user.

6. Add another Assign a Variable. It can be called subtractDate1. Add {{divide subtractDate 86400000}} to Value

7. Add Assign a Variable again. The variable name can be subtractDate1, the value must be {{round subtractDate1}}

So we got the difference in days and rounded it up.

8. After the work with the dates is completed, set a Tag for Trigger Event. The tag is set after the value of the variable, responsible for the number of days before Trigger is sent, has already been set.

9. Go to Settings and create Trigger Event with this tag.

10. In the Time field, output the {{subtractDate1}} variable, the unit of time is Days.

To the beginning ↑