Added condition before sending email, http://git.io/p2Hbxg