simplified retry logic for email notifications, getting rid of state variable