Hi Team,
I want to send an auto trigger email to customers that can run on every 1st and 4th friday of a month. However the automation rule is allowing me to choose only 1st Friday but i dont have the option to choose 4th Friday of every month. I have attached a snapshot for your reference. Please review and help me in selecting 4th friday of a month along with 1st Friday of a month.
Hi @Lakshmi Kumari ,
For the 4th friday of the month, you can set up a separate schedule rule using cron expression. Click on "Advanced" on the Scheduled dialog and use the following cron expression
0 0 6 22-28 * 5
The cron can be dissected as below:
* 0 - seconds
* 0 - minutes
* 6 - hour
* 22-28 - dates on which cron will run. This is because the 4th Friday of the month can only fall between 22nd and 28th.
* * - month (any)
5 - day of the week (Friday)
So this cron will run at 6 AM on any Friday of the month that falls between 22nd and 28th.
Hope that helps!
Actually I think you can cover both use cases in a single cron with something like this
0 0 6 1-7,22-28 * 5
With 1-7, and 22-28, you can cover the first and 4th weeks, and the 5 at the end ensures it only runs on Fridays.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Hariharan. Single cron worked for both the date conditions.. You are a saviour :-)
Cheers,
Lakshmi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm glad it worked. I just discovered there's a simpler way of doing this too. You can just use 5#4 for the 4th Friday of the month. So the cron can also be specified as
0 0 6 * * 5#1,5#4
Please check this documentation for more details.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.