Commit b594e4ab authored by Matija Obreza's avatar Matija Obreza

Don't die on missing validation email article

parent 2e4550b1
......@@ -65,10 +65,14 @@ public class EMailVerificationServiceImpl implements EMailVerificationService {
final VerificationToken verificationToken = tokenVerificationService.generateToken("email-verification", user.getUuid());
final Article article = contentService.getGlobalArticle("smtp.email-verification", Locale.ENGLISH);
final String mailSubject = article.getTitle();
final String mailBody = MessageFormat.format(article.getBody(), baseUrl, verificationToken.getUuid(), user.getEmail(), verificationToken.getKey());
if (article != null) {
final String mailSubject = article.getTitle();
final String mailBody = MessageFormat.format(article.getBody(), baseUrl, verificationToken.getUuid(), user.getEmail(), verificationToken.getKey());
emailService.sendMail(mailSubject, mailBody, user.getEmail());
emailService.sendMail(mailSubject, mailBody, user.getEmail());
} else {
LOG.warn("smtp.email-verification article not found. Not sending verification email");
}
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment