Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

Commit

Permalink
fix(email): sometimes email are not sent, sometimes with bad content
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasGeraud authored and brasseld committed Aug 18, 2017
1 parent ef25c69 commit d40fb3f
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -36,6 +36,7 @@

import javax.activation.MimetypesFileTypeMap;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
Expand All @@ -51,9 +52,6 @@ public class EmailServiceImpl extends TransactionalService implements EmailServi
@Autowired
private JavaMailSender mailSender;

@Autowired
private MimeMessageHelper mailMessage;

@Autowired
private Configuration freemarkerConfiguration;

Expand All @@ -66,6 +64,7 @@ public class EmailServiceImpl extends TransactionalService implements EmailServi
public void sendEmailNotification(final EmailNotification emailNotification) {
if (enabled) {
try {
MimeMessageHelper mailMessage = new MimeMessageHelper(mailSender.createMimeMessage(), true, StandardCharsets.UTF_8.name());
final Template template = freemarkerConfiguration.getTemplate(emailNotification.getContent());
final String htmlText =
FreeMarkerTemplateUtils.processTemplateIntoString(template, emailNotification.getParams());
Expand Down

0 comments on commit d40fb3f

Please sign in to comment.