@Override
    public void sendHtml(String toEmail, String toName, String subject, String htmlBody, String plainBody,
         Map<String, String> headers) throws EmailException {
        try {
            HtmlEmail email = new HtmlEmail();
            setCommonConfigElements(email, toName, toEmail, subject, headers);
            email.setHtmlMsg(htmlBody);
            email.setTextMsg(plainBody);
            email.send();
        } catch (org.apache.commons.mail.EmailException e) {
            throw new EmailException(e);
        }
        LOGGER.debug("HTML email notification sent. \n"
                         + "to: {0} \n"
                         + "toName: {1} \n"
                         + "subject: {2} \n"
                         + "HTML body: {3} \n"
                         + "plain body: {4} \n"
                         + "headers: {5}",
             toEmail, toName, subject, htmlBody, plainBody, headers);
    }
@author Marc Savy {@literal <marc@blackparrotlabs.io>}
manager/api/rest-impl/src/main/java/io/apiman/manager/api/notifications/email/EmailSender.java