Need to setup a generic logic to stop the recurring deliveries on sunday and holidays

roopals56103587

20-09-2019

Hi all,

I need to develop a logic within Adobe campaign classic to stop the recurring delivery on sundays and holidays and delivery should be sent out on next working day in a way that it includes previous day target also. If there is Sunday and holiday in a row then next working day delivery should include all the recipient missed due to holidays.

Is there any way to achieve the same.

Thanks in advance.

Roopal

Answers (3)

Answers (3)

Raj_bounteous

MVP

05-10-2019

Hi,

i have used javascript to check if particular day is weekend or US holiday or any company specific holiday and also hard coded few dates based on business rules. Attached is sample code and not the actual code I have used.

var holidays = { // keys are formatted as month,week,day
  
"0,2,1": "Martin Luther King, Jr. Day",
  
"1,2,1": "President's Day",
  
"2,1,0": "Daylight Savings Time Begins",
  
"3,3,3": "Administrative Assistants Day",
  
"4,1,0": "Mother's Day",
  
"4,-1,1": "Memorial Day",
  
"5,2,0": "Father's Day",
  
"6,2,0": "Parents Day",
  
"8,0,1": "Labor Day",
  
"8,1,0": "Grandparents Day",
  
"8,-1,0": "Gold Star Mothers Day",
  
"9,1,1": "Columbus Day",
  
"10,0,0": "Daylight Savings Time Ends",
  
"10,3,4": "Thanksgiving Day"
};
function getDate(year, month, week, day) {
  
var firstDay = 1;
  
if (week < 0) {
  month
++;
  firstDay
--;
  
}
  
var date = new Date(year, month, (week * 7) + firstDay);
  
if (day < date.getDay()) {
  day
+= 7;
  
}
  date
.setDate(date.getDate() - date.getDay() + day);
  
return date;
}
function getHoliday(month, week, day) {
  
return holidays[month + "," + week + "," + day];
}
function getDateString(year, month, week, day) {
  
var date = getDate(year, month, week, day);
  
var holiday = getHoliday(month, week, day);
  
var dateString = date.toLocaleDateString();
  
if (holiday) {
  dateString
+= " \xa0\xa0\xa0" + holiday;
  
}
  
return

Jean-Serge_Biro

MVP

23-09-2019

Hi Roopal,

2 solutions:

  • use of Incremental Query activity in your workflow: each execution takes the data not already treated. So when something is suspended, it takes the old data (your weekend data) to send it at next execution planified; please see the 2nd tab of the activity, it includes the planification for execution, so you must not set an Planification activity before.
  • do it by your own, with an instance variable or an xtk:option (with getOption at the workflow start and setOption at the end) to set the last record treated. And please put the variable in the Query criteria filters.
    Of course with a planification activity must be put before the Query activity.


Regards
J-Serge