class MailChannel implements Channel {

    @Retryable
    public void send(Subscriber subscriber, List<NotificationEventTO> events) throws Exception {
        try {
            mailService.sendMailWithTemplate(emailBuilder.getTemplateMailTO(subscriber.getIdentity().getAttributes().getEmail(), events));
        } catch (MailException e) {
            String message = e.getMessage();
            if (message != null && !message.isEmpty() && message.indexOf("Invalid Addresses") > 0) {
                // bypass the retry
                log.error("Invalid Addresses detected !!!", e);
                throw new InvalidAddressException(e);
            }
            throw e;
        }
    }

}