This article will help you to delay the sending of your e-mails. Maybe you would like to wait two days before you ask feedback after a purchase, because there is a shipping time. 


With an expert rule you can delay your invitation send out in 3 steps.

Step 1
First you will need to create a definition column in your data garden called "DateToSend2". It's really import to make that the column format is set to subtype DATE (see the image below)



Step 2
In the rules tab of your database, in the creating records section, you need to add a new expert rule. Use the script below and add this to your Expert code field.


***** script ****

var CurrentDate = new Date();

var DateToSend = new Date(CurrentDate);


DateToSend.setDate(DateToSend.getDate()+ 2);

DRE.createOrChangeValueInDB("DateToSend2", DateToSend);


******


Only paste the text so it looks like this:




In this script, the new column will be filled with a date which is two days after today. This is done by the + 2 part of the script. If you would like to use a different delay, for example 10 days, you will change this 2 into 10 in your script.


At the moment a new import is done, this new column with the correct send out date is automatically filled for each record.


Step 3
And as a final step, it is necessary for you to create an extra condition in the email scheduler that you would like to apply your delay. You can set this in the Enrollment criteria tab, by adding the condition that the date in the new column should be before todays date. Like in the example below:


In other words: if the date in the new column is set to June 1st 2021, the scheduler is allowed to send out the email on June 2nd 2021 or later.


Please note: We use the IS BEFORE criteria in this example as a safety. If you use the IS option, there is only one specific day on which your record is allowed to be sent. If your scheduler is perhaps not active on that day, the record will never be sent. With this setup, it will be automatically picked up in the next run, as long as the allowed date to sent has passed.