}
protected boolean sendAnswerNotification(Answer answer) throws ApsSystemException {
boolean sent = false;
try {
Message message = this.getMessage(answer.getMessageId());
MessageTypeNotifierConfig config = this.getNotifierConfig(message.getTypeCode());
if (config != null) {
String email = this.extractUserMail(message, config);
if (null!=email) {
String renderingLangCode = message.getLangCode();
if (renderingLangCode==null || this.getLangManager().getLang(renderingLangCode)==null) {
renderingLangCode = this.getLangManager().getDefaultLang().getCode();
}
MessageModel messageModel = config.getMessageModel();
String subject = this.getEntityRenderer().render(message, messageModel.getSubjectModel(), renderingLangCode, false);
subject = "RE: " + subject;
String text = answer.getText();
String senderCode = config.getSenderCode();
String[] recipientsTo = new String[] { email };
Properties attachmentFiles = answer.getAttachments();
this.getMailManager().sendMail(text, subject, IMailManager.CONTENTTYPE_TEXT_PLAIN,
attachmentFiles, recipientsTo, null, null, senderCode);
sent = true;
} else {
ApsSystemUtils.getLogger().warn("ATTENTION: email Attribute \"" +
config.getMailAttrName() + "\" for Message \"" + message.getId() +
"\" isn't valued!!\nCheck \"jpwebdynamicform_messageTypes\" Configuration or " +
"\"" + JpwebdynamicformSystemConstants.MESSAGE_NOTIFIER_CONFIG_ITEM + "\" Configuration");
}
} else {
ApsSystemUtils.getLogger().warn("Answer not sent! Message lacking in notifier configuration.");