Skip to content

Commit

Permalink
A small code specification change. (apache#2299)
Browse files Browse the repository at this point in the history
  • Loading branch information
TJxiaobao authored Jul 17, 2024
1 parent 38d466b commit 07913e7
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.hertzbeat.manager.service.impl;

import freemarker.cache.StringTemplateLoader;
import freemarker.core.TemplateClassResolver;
import freemarker.template.Configuration;
import freemarker.template.TemplateException;
import java.io.IOException;
Expand Down Expand Up @@ -99,6 +100,7 @@ public String buildAlertHtmlTemplate(final Alert alert, NoticeTemplate noticeTem
String templateName = "mailTemplate";
stringLoader.putTemplate(templateName, noticeTemplate.getContent());
cfg.setTemplateLoader(stringLoader);
cfg.setNewBuiltinClassResolver(TemplateClassResolver.SAFER_RESOLVER);
templateMail = cfg.getTemplate(templateName, Locale.CHINESE);
return FreeMarkerTemplateUtils.processTemplateIntoString(templateMail, model);
}
Expand Down

0 comments on commit 07913e7

Please sign in to comment.