Use an if() condition with the pattern for sending the email.