Inject SpringTemplateEngine into AppealMail and remove redundant field initialization.
This commit is contained in:
@@ -18,6 +18,7 @@ import org.thymeleaf.spring6.SpringTemplateEngine;
|
|||||||
public class AppealMail {
|
public class AppealMail {
|
||||||
|
|
||||||
private final JavaMailSender mailSender;
|
private final JavaMailSender mailSender;
|
||||||
|
private final SpringTemplateEngine templateEngine;
|
||||||
|
|
||||||
@Value("${spring.mail.username}")
|
@Value("${spring.mail.username}")
|
||||||
private String fromEmail;
|
private String fromEmail;
|
||||||
@@ -39,8 +40,6 @@ public class AppealMail {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private SpringTemplateEngine templateEngine;
|
|
||||||
|
|
||||||
private void sendEmailToAppealsTeam(Appeal appeal) throws MessagingException {
|
private void sendEmailToAppealsTeam(Appeal appeal) throws MessagingException {
|
||||||
MimeMessage message = mailSender.createMimeMessage();
|
MimeMessage message = mailSender.createMimeMessage();
|
||||||
MimeMessageHelper helper = new MimeMessageHelper(message, true);
|
MimeMessageHelper helper = new MimeMessageHelper(message, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user