Expand my Community achievements bar.

SOLVED

Don't send deliveries after 8 pm?

Avatar

Level 5

Hi, there is going to be a law in my country that prohibits compnanies to send comunications after 8 pm.

I understand this law is also present in other countries, like France. 

How do you manage this so Campaigns stops sending deliveries after 8 pm?   

I'm looking for a global option, since leaving this to the criteria of each users is going to be complicated and phrone to errors.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @ogonzalesdiaz ,

This cannot be done by making some global system setting in deployment wizard.

Rather, you can create a control typology rule  and assign it to all typology in your instance.

Try the below approach, if the delivery is triggered after 8PM, this will postpone to next day's 9AM. And if the delivery is triggered before 8AM, delivery will get postponed to same day 9AM. So that any recipient won't be receiving email during OFF time.

Step-1: Create a new typology rule

Step-2:

In general tab,

select Rule type as 'Control'

Channel: All channels

Level: Warning 

ParthaSarathy_0-1699893391736.png

Step-3: In Code Tab, paste the below script

var Hour = formatDate(new Date(), "%2H");
if( Hour >= 20)
{
logWarning("Delivery is triggered during OFF time");
var hour1 = ((24-parseInt(Hour)+9))*60*60*1000;
var scheduledDate = new Date(new Date().getTime()+parseInt(hour1));
delivery.scheduling.contactDate= scheduledDate;
delivery.scheduling.delayed = 1; 
logWarning("Rescheduling the delivery to "+scheduledDate);
}
if( Hour < 8)
{
logWarning("Delivery is triggered during OFF time");
var hour1 = (9-parseInt(Hour))*60*60*1000;
var scheduledDate = new Date(new Date().getTime()+parseInt(hour1));
delivery.scheduling.contactDate= scheduledDate;
delivery.scheduling.delayed = 1; 
logWarning("Rescheduling the delivery to "+scheduledDate);
}

 

Step-4: In Typology tab, Add all the typologies from your environment including out of the box's Default typology and Save it.

 

So, as mentioned before, if the delivery is triggered after 8PM, delivery will get postpone to next day's 9AM.

And if the delivery is triggered before 8AM, then the delivery will get postponed to same day's 9AM. So that any recipient won't be receiving email or any communications during OFF time.

In Delivery > Audit tab, you can able to see the below warning, and the delivery will be Rescheduled.

ParthaSarathy_1-1699893738659.png

View solution in original post

6 Replies

Avatar

Correct answer by
Community Advisor

Hi @ogonzalesdiaz ,

This cannot be done by making some global system setting in deployment wizard.

Rather, you can create a control typology rule  and assign it to all typology in your instance.

Try the below approach, if the delivery is triggered after 8PM, this will postpone to next day's 9AM. And if the delivery is triggered before 8AM, delivery will get postponed to same day 9AM. So that any recipient won't be receiving email during OFF time.

Step-1: Create a new typology rule

Step-2:

In general tab,

select Rule type as 'Control'

Channel: All channels

Level: Warning 

ParthaSarathy_0-1699893391736.png

Step-3: In Code Tab, paste the below script

var Hour = formatDate(new Date(), "%2H");
if( Hour >= 20)
{
logWarning("Delivery is triggered during OFF time");
var hour1 = ((24-parseInt(Hour)+9))*60*60*1000;
var scheduledDate = new Date(new Date().getTime()+parseInt(hour1));
delivery.scheduling.contactDate= scheduledDate;
delivery.scheduling.delayed = 1; 
logWarning("Rescheduling the delivery to "+scheduledDate);
}
if( Hour < 8)
{
logWarning("Delivery is triggered during OFF time");
var hour1 = (9-parseInt(Hour))*60*60*1000;
var scheduledDate = new Date(new Date().getTime()+parseInt(hour1));
delivery.scheduling.contactDate= scheduledDate;
delivery.scheduling.delayed = 1; 
logWarning("Rescheduling the delivery to "+scheduledDate);
}

 

Step-4: In Typology tab, Add all the typologies from your environment including out of the box's Default typology and Save it.

 

So, as mentioned before, if the delivery is triggered after 8PM, delivery will get postpone to next day's 9AM.

And if the delivery is triggered before 8AM, then the delivery will get postponed to same day's 9AM. So that any recipient won't be receiving email or any communications during OFF time.

In Delivery > Audit tab, you can able to see the below warning, and the delivery will be Rescheduled.

ParthaSarathy_1-1699893738659.png

Avatar

Community Advisor

Hello @ogonzalesdiaz 

 

This can be a bit tricky and even after a workaround, there is still a possibility of customers getting the emails.

 

  1. Add a Javascript in the workflow template to check if the workflow is scheduled then don't execute the WF.
  2. Add a typology rule in delivery to stop the execution if the timing is after 9 PM
  3. Another thing to consider is retires and waves: If you have deployed a campaign at 6 pm and it is deployed in waves. How to handle the deployment?
  4. If the email is deployed at 6 pm and Campaign tries to send the failed deliveries after 1h and possibly deliver it after 6 retires then the email will land at 10 pm.

 

There is no best practice or accurate solution available for this. But you will have to Javascript heavily to accommodate all these scenarios.

 

 


     Manoj
     Find me on LinkedIn

Avatar

Level 5

hi @ParthaSarathy , where do you find documentation about the objects: 

delivery.scheduling.contactDate



For example, here you use the "delivery" object and access its scheduling process. and contactDate property.  I didn't know about these. Where may I find the docs?  

Avatar

Community Advisor

@ogonzalesdiaz , not sure about the documentation link, but when you trigger a delivery or create a new delivery and set a scheduling time, the delivery will get triggered during the contact date of the delivery.

ParthaSarathy_1-1699983118489.png

And in nms:delivery schema, contact date will be stored in as [scheduling/@contactDate]

ParthaSarathy_0-1699982932255.png

Avatar

Level 5

@ParthaSarathy will this work with deliveries with "waves" activated?

Also, how would this handle retries?

Avatar

Community Advisor

@ogonzalesdiaz , As Manoj mentioned, there is no accurate solution for this when it is scheduled as a wave. Mostly wave scheduled campaign will be used for one time send campaigns and not for recurring campaigns. So you can advise the campaign developers to schedule a wave campaign which will not have a wave scheduled after 8PM.

Lets say the campaign is planned to trigger at 7PM in 4 waves, then Campaign developer needs to give scheduling as below (by giving 14hrs gap between 1st and 2nd wave, so that 2nd wave will get triggered at next day 9AM)

ParthaSarathy_1-1700027777465.png