# Dynamic Reporting issue send mail based on day selection

**URL:** <https://forum.inductiveautomation.com/t/dynamic-reporting-issue-send-mail-based-on-day-selection/46064>\
**Category:** Ignition\
**Created:** [April 27, 2021, 11:15am UTC](https://forum.inductiveautomation.com/t/dynamic-reporting-issue-send-mail-based-on-day-selection/46064 "2021-04-27T11:15:34Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![matthew.ayre](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matthew.ayre/32/19499_2.png) [@matthew.ayre](https://forum.inductiveautomation.com/u/matthew.ayre)\
**Post date:** [April 27, 2021, 11:31am UTC](https://forum.inductiveautomation.com/t/dynamic-reporting-issue-send-mail-based-on-day-selection/46064/2 "2021-04-27T11:31:30Z")

</div>

Hi @prasath.t, can you use %A to get the weekday name and check for this in your first if statement?

You may also be interested in the future 8.1.6 release, as this contains [cron-based scripting event](http://forum.inductiveautomation.com/t/nightly-8-1-changelogs-2021/42410/69).

Also, slight note on using sleep in scripts. It can be considered bad practice in locking the thread with sleep (see [here](https://docs.inductiveautomation.com/display/DOC81/Adding+a+Delay+to+a+Script) for further information). Although, in your case it’s a Gateway scoped script, so might not be so much of an issue. Just a minor observation 🙂

---

_[View the full topic](https://forum.inductiveautomation.com/t/dynamic-reporting-issue-send-mail-based-on-day-selection/46064)._
