I have a foreach loop on a dashboard page where I sorting the pages titles to different columns based on a date field. Unfortunately, I am doing it with multiple different if statements for the sorting (with multiple foreach loops), as I needed something quickly for testing. I thought it would be nice to implement wireSMTP to send an email out to alert the users that created the pages, which I got working in no time. However, now I have hit a roadblock. The dashboard page has a javascript function that refreshes the page every few hours to get the changes in the date, which then triggers the $mail to fire the email out.
I guess my question is there a way to limit the emails to be sent out only once the date/time has changed once instead of it firing every time the page refreshes?