use of com.junliang.spring.pojo.bean.Email in project spring-boot by Linda-Tan.
the class TestController method sendEmailTemplate.
@GetMapping("sendEmailTemplate")
public BaseResponse sendEmailTemplate() {
try {
Email email = new Email();
Map<String, String> map = new HashMap<>(2);
map.put("text", "welcome");
email.setKvMap(map);
email.setTemplate("welcome");
email.setEmail(new String[] { "tyf201314@qq.com" });
email.setSubject("默认主题");
email.setCc(new String[] { "li926893@gmail.com" });
emailService.sendBytemplate(email);
return new ObjectRestResponse("hellowzho直接后果orld");
} catch (Exception ex) {
log.error("发送失败", ex);
return new BaseResponse(4000, "发送失败");
}
}
Aggregations