Hello there,
I've started on a local plugin to build with, knowing it's better than hacking the core code for upgrades down the road, but wanted to know if anyone has input to share on the best way to do the following:
- Automate an email via CRON to send custom SQL results (would love to do it via the "Configurable reports block plugin" in the admin, but can't seem to see it and don't want to update the module's code so our changes won't be overridden in the future upgrades.
- Send the email to a recipient (to be managed as an editable field in the admin) with the SQL results as an Excel attachment, to be sent daily and only include the results from the day before.
Anyone have ideas on the best way to implement this? I'll continue to build, but thought I'd reach out to the community to see if there's a better solution.
Possibly just setting up a moodle/cron.php file in the main directory and calling it via a cronjob at midnight every night.
Cheers!