Script for pulling and sending notification mails