| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.vincent.rsf.common.utils.Utils; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.server.system.enums.EmailType; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | @SuppressWarnings("all") |
| | | private JavaMailSender mailSender; |
| | | |
| | | public boolean sendEmail(String to, String subject, Map<String, Object> param) { |
| | | public boolean sendEmail(String to, EmailType emailType, Map<String, Object> param) { |
| | | |
| | | String content = "Your verification code is: ${code}"; |
| | | String subject = emailType.subject; |
| | | String content = emailType.content; |
| | | if (!Cools.isEmpty(param) && !param.isEmpty()) { |
| | | content = Utils.processTemplate(content, param); |
| | | } |