Dunno if it’s polite to link to a different blog, but I found the mail function here:
https://www.zealfortechnology.com/2018/08/configure-unattended-upgrades-on-raspberry-pi.html