sending an email when the database is updated