adding email notification functionality