Skip to content
Snippets Groups Projects
Commit 9a8e0444 authored by Lukasz Lopatowski's avatar Lukasz Lopatowski
Browse files

Tyring to fix an issue with email content preparation

parent af6bf4b6
No related branches found
No related tags found
No related merge requests found
Pipeline #88903 passed
...@@ -31,7 +31,7 @@ public class NotificationController { ...@@ -31,7 +31,7 @@ public class NotificationController {
// TODO verify if captcha token must be verified // TODO verify if captcha token must be verified
MailType mailType = mailAttributes.getMailType(); MailType mailType = mailAttributes.getMailType();
if(mailType.equals(MailType.CONTACT_FORM) || mailType.equals(MailType.ISSUE_REPORT) || mailType.equals(MailType.NEW_DOMAIN_REQUEST)) { if (mailType.equals(MailType.CONTACT_FORM) || mailType.equals(MailType.ISSUE_REPORT) || mailType.equals(MailType.NEW_DOMAIN_REQUEST)) {
eventPublisher.publishEvent(new NotificationEvent(this, mailAttributes)); eventPublisher.publishEvent(new NotificationEvent(this, mailAttributes));
} else { } else {
throw new AuthenticationException("You are not allowed to send this mail"); throw new AuthenticationException("You are not allowed to send this mail");
......
...@@ -70,7 +70,7 @@ public class NotificationManager { ...@@ -70,7 +70,7 @@ public class NotificationManager {
try { try {
template = templateService.getHTMLTemplate(); template = templateService.getHTMLTemplate();
} catch (IOException e) { } catch (IOException e) {
log.error(String.format("Cannot retrieve html template: %s", e.getMessage())); log.error("Cannot retrieve html template: {}", e.getMessage());
throw new ProcessingException(e); throw new ProcessingException(e);
} }
...@@ -193,7 +193,7 @@ public class NotificationManager { ...@@ -193,7 +193,7 @@ public class NotificationManager {
} }
private String getFilledTemplate(Template template, LanguageMailContentView langContent, UserView user, MailAttributes mailAttributes, MailTemplateView mailTemplate) throws IOException, TemplateException { private String getFilledTemplate(Template template, LanguageMailContentView langContent, UserView user, MailAttributes mailAttributes, MailTemplateView mailTemplate) throws IOException, TemplateException {
boolean showAdditional = mailAttributes.getOtherAttributes().get("message") != null; boolean showAdditional = mailAttributes.getMailType() == MailType.NEW_ACTIVE_APP && mailAttributes.getOtherAttributes().get("message") != null;
return FreeMarkerTemplateUtils.processTemplateIntoString(template, ImmutableMap.builder() return FreeMarkerTemplateUtils.processTemplateIntoString(template, ImmutableMap.builder()
.putAll(mailTemplate.getGlobalInformation()) .putAll(mailTemplate.getGlobalInformation())
.put(MailTemplateElements.PORTAL_LINK, this.portalAddress == null ? "" : this.portalAddress) .put(MailTemplateElements.PORTAL_LINK, this.portalAddress == null ? "" : this.portalAddress)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment