How to send automated task summary mail to users?

I wanted to surface this possible solution by Codan @Ben_Lee: