Added null check for email before sending notifications