if (!CMBProperties.getInstance().getSmtpEnabled()) {
logger.warn("event=send_email error_code=smtp_disabled endpoint=" + endpoint);
return;
}
MailWrapper mailAgent = new MailWrapper();
String msg = null;
if (message.getMessageStructure() == CNSMessageStructure.json) {
msg = message.getProtocolSpecificMessage(CnsSubscriptionProtocol.email_json);
} else {
msg = message.getMessage();
}
if (!rawMessageDelivery && message.getMessageType() == CNSMessageType.Notification) {
msg = com.comcast.cns.util.Util.generateMessageJson(message, CnsSubscriptionProtocol.email_json);
}
logger.debug("event=send_email endpoint=" + endpoint + " subject=\"" + subject + " message=\"" + msg + "\"");
mailAgent.postMail(new String [] { endpoint }, subject, msg, CMBProperties.getInstance().getSmtpReplyAddress());
}