How to send belated birthday of the last few day of the year and send new birthday email template for the new year?

Before Every new year,there is a need to create a new birthday email template for the new year in html format.

My robot is checking last run date as an input dialog to differiate between sending out belated birthday email for dob > last run date and send out birthday email for today date. I unable to run the bot on weekend and public holiday.

First scenario: What if a certain year where 31 dec of the year falls on the saturday. And i only able to run the robot on the next working day of the new year?

Second scenario: what if 31 dec falls on Sunday ,then i only able to run the robot on the 3rd of jan (tuesday) as 1st jan is a new year and 2nd jan is a entitlement public holiday.

How do i develop the bot to know that the bot have to use the last year birthday template by selecting file of the last year birthday email template for the belated birthday when i run the bot on any of the first few days of the new year?

Thanks.

Hello @SITI_NUR_ALYSHYIA, for this you can create an Excel file containing the list of public holidays and weekend dates.

Next, you can fetch today’s date using Now.ToString(dd/MM/yyyy) and check if this date exists in the Excel list using a simple if condition. If it exists, you can ignore this email and update the Excel file accordingly and if not, you can send an email.

Fetching the last year’s file depends on your file name and where it exists. Could you elaborate on that one?

Hi @monsieurrahul,

But I would not be running the bot on public holiday and weekend, so I would not be able to use Now.ToString. Hence the use of last run date so the robot will be able to check DOB in the excel file that are less than the last run date and DOB is today.

Before the robot process, there is a select file activity where i will select the birthday template to be use. For example filename of the birthday template for the year 2020 is BirthdayTemplate2020.txt. The content is html as it is an email template with embedded image in it.

Then for the year 2021 or other year, the filename of a new birthday template with different content and embedded image will be BirthdayTemplate2021.txt and so on.

The problem is when I run the bot on the new year of 2021 or other years that are on the working day, how would the robot knows for the DOB for less than 1 Jan of the new year will be using the BirthdayTemplate2020.txt and then the 1st Jan or any other working day of the new year will be using the BirhdayTemplate2021.txt or other year template. Because every year, 31st Dec and 1st Jan may fall on weekend.

Check this: