}
}
private String createBody(UserDetails user, List<ContentMailInfo> contentsToNotifyToUser, Map<String, SmallContentType> smallContentTypes) {
String defaultLangCode = this.getLangManager().getDefaultLang().getCode();
NotifierConfig config = this.getConfig();
StringBuffer body = new StringBuffer(config.getHeader());
for (ContentMailInfo info : contentsToNotifyToUser) {
SmallContentType smallContentType = (SmallContentType) smallContentTypes.get(info.getContentTypeCode());
String link = this.createLink(info, defaultLangCode);
Map<String, String> params = this.prepareContentParams(info, smallContentType, link);
switch (info.getOperationCode()) {
case PublicContentChangedEvent.INSERT_OPERATION_CODE:
body.append(this.replaceParams(config.getTemplateInsert(), params));
break;
case PublicContentChangedEvent.UPDATE_OPERATION_CODE:
body.append(this.replaceParams(config.getTemplateUpdate(), params));
break;
case PublicContentChangedEvent.REMOVE_OPERATION_CODE:
body.append(this.replaceParams(config.getTemplateRemove(), params));
break;
}
}
body.append(config.getFooter());
return body.toString();
}