Don't send deliveries after 8 pm? | Community
Skip to main content
Level 6
November 10, 2023
Solved

Don't send deliveries after 8 pm?

  • November 10, 2023
  • 2 replies
  • 1423 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by ParthaSarathy

Hi @god_prophet ,

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 

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.

2 replies

ParthaSarathy
Community Advisor
ParthaSarathyCommunity AdvisorAccepted solution
Community Advisor
November 13, 2023

Hi @god_prophet ,

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 

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 S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups
Manoj_Kumar
Community Advisor
Community Advisor
November 13, 2023

Hello @god_prophet 

 

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  | https://themartech.pro
Level 6
November 14, 2023

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?  

ParthaSarathy
Community Advisor
Community Advisor
November 14, 2023

@god_prophet , 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.

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

~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups