Added null checking for email and text sending.