Added sending emails for completed tasks