Expand my Community achievements bar.

Adobe Campaign User Groups are live now. Join our Adobe Campaign User Groups and connect with your local leaders!
SOLVED

To send weekly campaign on every friday

Avatar

Level 1

Hi Team,

Every Friday at 12 PM, a reminder email campaign should be sent; if Friday is a holiday, the campaign should be sent the day before.
If both Thursday and Friday fall as holidays, an email should be sent on Wednesday.

Thanks,

Topics

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @sarjoon ,

You can use the same logic of one of the previous community post https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/monthly-and-weekly...

But the challenge is ACC is not aware of when is the holiday on Thursday and Friday. So before creating the campaign, you have to note down the possible leave dates on Friday (where Thursday is working day) and possible leave scenario dates where both Thursday and Friday are holiday.

Note down the above mentioned dates in MM-DD format (example, Jan-26th as 01-26 and October-3rd as 10-03)

Create a campaign as below,

ParthaSarathy_0-1706017306798.png

 

Scheduler:

Configure the scheduler to Run on WEDNESDAY as per below screenshot,

ParthaSarathy_1-1706017424951.png

 

Open Scheduler > Advance tab > Initialization script and paste the below code,

var getDateAfter2Days = new Date();
getDateAfter2Days.setDate(getDateAfter2Days.getDate() + 2);
getDateAfter2Days = formatDate(getDateAfter2Days, "%2M-%2D");
vars.dateAfter2Days = getDateAfter2Days;

Test Activity:

ParthaSarathy_3-1706017835518.png

//Condition1: (Label: Holiday on Friday)
vars.dateAfter2Days== '01-26' || vars.dateAfter2Days == '08-02'   || vars.dateAfter2Days == '12-06' 

//Condition2: (Label: Holiday on Both Thursday and Friday)
vars.dateAfter2Days== '01-05' || vars.dateAfter2Days == '02-23'

//Default connection Label as 'Friday - Working Day'

As mentioned above, use the date format in MM-DD. If you have multiple dates, then separate the dates with OR operator using the symbol ||

 

Wait Activity:

Define duration of 1d for Holiday on Friday's transition

and 2d for Friday - Working Day's transition.

ParthaSarathy_4-1706018407703.png

And connect all 3 transitions to a fork activity (Refer workflow diagram)

 

So, As a result, now when the workflow runs on every Friday, it will format the date in MM-DD format and store it in variable.

If MM-DD (Both Thursday and Friday is on Holiday), the workflow will get executed on Wednesday itself.

f MM-DD (If Thursday Working day and Friday is on Holiday), the workflow will wait for 1 day (using wait activity) and get executed on Thursday.

If MM-DD ( Friday is on workday), as the workflow triggers on every Wednesday, it will wait for 2 days (using wait activity) and get executed on Friday.

View solution in original post

2 Replies

Avatar

Employee Advisor

Hi Sarjoon,

Please take a look at the link to the post below, which should answer your question:

https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/monthly-and-weekly...

 

Regards,

Craig

Avatar

Correct answer by
Community Advisor

Hi @sarjoon ,

You can use the same logic of one of the previous community post https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/monthly-and-weekly...

But the challenge is ACC is not aware of when is the holiday on Thursday and Friday. So before creating the campaign, you have to note down the possible leave dates on Friday (where Thursday is working day) and possible leave scenario dates where both Thursday and Friday are holiday.

Note down the above mentioned dates in MM-DD format (example, Jan-26th as 01-26 and October-3rd as 10-03)

Create a campaign as below,

ParthaSarathy_0-1706017306798.png

 

Scheduler:

Configure the scheduler to Run on WEDNESDAY as per below screenshot,

ParthaSarathy_1-1706017424951.png

 

Open Scheduler > Advance tab > Initialization script and paste the below code,

var getDateAfter2Days = new Date();
getDateAfter2Days.setDate(getDateAfter2Days.getDate() + 2);
getDateAfter2Days = formatDate(getDateAfter2Days, "%2M-%2D");
vars.dateAfter2Days = getDateAfter2Days;

Test Activity:

ParthaSarathy_3-1706017835518.png

//Condition1: (Label: Holiday on Friday)
vars.dateAfter2Days== '01-26' || vars.dateAfter2Days == '08-02'   || vars.dateAfter2Days == '12-06' 

//Condition2: (Label: Holiday on Both Thursday and Friday)
vars.dateAfter2Days== '01-05' || vars.dateAfter2Days == '02-23'

//Default connection Label as 'Friday - Working Day'

As mentioned above, use the date format in MM-DD. If you have multiple dates, then separate the dates with OR operator using the symbol ||

 

Wait Activity:

Define duration of 1d for Holiday on Friday's transition

and 2d for Friday - Working Day's transition.

ParthaSarathy_4-1706018407703.png

And connect all 3 transitions to a fork activity (Refer workflow diagram)

 

So, As a result, now when the workflow runs on every Friday, it will format the date in MM-DD format and store it in variable.

If MM-DD (Both Thursday and Friday is on Holiday), the workflow will get executed on Wednesday itself.

f MM-DD (If Thursday Working day and Friday is on Holiday), the workflow will wait for 1 day (using wait activity) and get executed on Thursday.

If MM-DD ( Friday is on workday), as the workflow triggers on every Wednesday, it will wait for 2 days (using wait activity) and get executed on Friday.