Holidays are not part of the .Net Api. So we have to take care extra about this.
Implementations using a list are common, when such a part is modelled. It also depends to your more detail requirements e.g. different holidays of substates for a country etc.
looking to the requirement:
we would recommend also to specify the case:
today any weekday except monday, but yestrday was no holiday
You could make a list of holiday dates and put them into an asset, then use that asset in your automation. Most holidays are simple, though - 1/1, 7/4, etc.
The tricky ones are Thanksgiving - you’d have to calculate if it’s the fourth Thursday of the month.
Easter? Basically impossible to calculate unless you’ve also got a Moon phase chart available to read.
In the end, making a list of holidays for the current year and updating it every year is about the only reliable solution I’ve ever seen. Of course, you could make your asset contain every holiday date for the next 50 years if you wanted, then never have to touch it again.
focus on the email list and its creation / retrieval
Have a check on:
a list of holidays of the year
a calculation on dates incorporating the holiday list
could have as a result which can be used for email filter when retrieving the emails e.g. get Mail XX activity (XX-Outlook, Exchange…)
So we have a chance to retrieve only the relevant emails. Maybe this helps.