public static boolean sendEmail(String emailStr, String topic, String body) { Email email = Email.create(emailStr); if (!emailValidator.validate(email)) { return false; } return emailService.send(email, topic, body); }
public static ContactsBookPackage addEmail(String email) { if (emailValidator.validate(Email.create(email))) { return new EmailContactsBookPackage(email, personDAO); } return new NullContactsBookPackage(); }