提交 9b07f433 authored 作者: luojie's avatar luojie

修改发送邮箱为阿里云企业邮箱,并解决邮箱逗号问题,增加邮箱验证码背景图

上级 67f11d21
...@@ -26,6 +26,7 @@ import com.diaoyun.zion.master.util.*; ...@@ -26,6 +26,7 @@ import com.diaoyun.zion.master.util.*;
import freemarker.template.TemplateException; import freemarker.template.TemplateException;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.mail.EmailException; import org.apache.commons.mail.EmailException;
import org.slf4j.ILoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.AuthenticationManager;
......
...@@ -36,7 +36,7 @@ public class EmailHelper { ...@@ -36,7 +36,7 @@ public class EmailHelper {
cfg.setDefaultEncoding(Consts.UTF_8.name()); cfg.setDefaultEncoding(Consts.UTF_8.name());
cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);*/ cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);*/
Template t = configuration.getTemplate(templateName); Template t = configuration.getTemplate(templateName);
Map<String, Object> model = new HashMap<>(); Map<String,Object> model = new HashMap<>();
model.put("identifyCode", emailTemplateBo.getIdentifyCode()); model.put("identifyCode", emailTemplateBo.getIdentifyCode());
model.put("nick", emailTemplateBo.getNick()); model.put("nick", emailTemplateBo.getNick());
String html = FreeMarkerTemplateUtils.processTemplateIntoString(t, model); String html = FreeMarkerTemplateUtils.processTemplateIntoString(t, model);
......
...@@ -9,12 +9,12 @@ package com.diaoyun.zion.master.util; ...@@ -9,12 +9,12 @@ package com.diaoyun.zion.master.util;
*/ */
public class RandomCodeHelper { public class RandomCodeHelper {
public static int producedRandomCode(double length) { public static int producedRandomCode(double length) {
int randomCode = (int)(Math.random() * Math.pow(10, length)); int randomCode = (int)(Math.random() * Math.pow(10,length));
//进制系统,这里是10进制 //进制系统,这里是10进制
int decimalSystem = 10; int decimalSystem = 10;
while(randomCode < Math.pow(decimalSystem, length-1) || randomCode >= Math.pow(decimalSystem, length)) { while(randomCode < Math.pow(decimalSystem, length-1) || randomCode >= Math.pow(decimalSystem, length)) {
randomCode = (int)(Math.random() * Math.pow(10, length)); randomCode = (int)(Math.random() * Math.pow(10,length));
} }
return randomCode; return randomCode;
......
...@@ -304,7 +304,7 @@ ...@@ -304,7 +304,7 @@
<select id="getCouponAndVaildAll" resultType="com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity"> <select id="getCouponAndVaildAll" resultType="com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity">
select select
`coupon_id`, `coupon_id`,
`coupon_category_id`, `coupon_category_id`,
`coupon_use`, `coupon_use`,
`coupon_title`, `coupon_title`,
......
...@@ -11,14 +11,14 @@ user.avatar=https://dev.diaosaas.com/upload/chinafrica/user/avatar.png ...@@ -11,14 +11,14 @@ user.avatar=https://dev.diaosaas.com/upload/chinafrica/user/avatar.png
#email.from.name=chinafrica #email.from.name=chinafrica
#email.authentication.userName=chinafrica@yeah.net #email.authentication.userName=chinafrica@yeah.net
#email.authentication.password=diaoyun2019 #email.authentication.password=diaoyun2019
#腾讯企业邮箱 #阿里企业邮箱
email.hostName=smtp.exmail.qq.com email.hostName=smtp.mxhichina.com
email.from.email=joe.chow@diaocode.com email.from.email=official@afrieshop.com
email.from.name=chinafrica email.from.name=Afrishop
email.authentication.userName=joe.chow@diaocode.com email.authentication.userName=official@afrieshop.com
email.authentication.password=Yinggainuli.8 email.authentication.password=Afri123456
#发送主题 #发送主题
email.subject=Verification Code from Chinafrica email.subject=Verification Code from Afrishop
###################################邮箱 END############################################### ###################################邮箱 END###############################################
################redis有效时间################### ################redis有效时间###################
......
...@@ -5,97 +5,14 @@ ...@@ -5,97 +5,14 @@
</head> </head>
<body> <body>
<section style="width: 600px;height :720px;background: #FFF8B3;margin:0 auto;box-sizing: border-box;padding: 20px 20px 62px 20px;">
<div style="width:100%;height:100%; background:#fff;border-radius: 8px;position:relative;box-shadow:0px 3px 6px rgba(250,185,5,0.25);top:-45px">
<style type="text/css"> <img style="position:absolute;width:100%;top:0;left:0;" src="https://diaopaas.com/wk_vote_node/public/africa-email.png" alt="背景图">
.qmbox .ReadMsgBody { <div style="margin-top:-45px;width: 70%;word-wrap:break-word; word-break:break-all;font-size: 16px;padding-top:243px;text-align:center;margin:0 auto;line-height: 24px;color:#272626;font-weight:400;">${nick}, Welcome to Afrishop! Before we begin</br> shopping, we need to quickly verify</br> your email address.</div>
width: 100%; <p style="font-size:16px;font-weight:bolder;line-height:32px;color:rgba(39,38,38,1);text-align: center;margin-top:15px;">Your verification code is:</p>
} <div style="width:150px;margin-top:-45px;height:36px;background:rgba(254,230,6,1);border-radius: 2px;margin: 0 auto;font-size:16px;font-weight:bolder;line-height:36px;color:rgba(39,38,38,1);text-align: center;">${identifyCode?c}</div>
<span style="font-size:12px;font-family:'SF UI Text';font-weight:400;line-height:16px;color:rgba(210,209,207,1);opacity:1;bottom:30px;display: block;text-align: center;">By Afrishop</span>
.qmbox .ExternalClass { </div>
width: 100%; </section>
}
@media only screen and (max-width: 479px) {
.qmbox td[class="web"], .qmbox table[class="web"] {
display: none !important;
}
} </style>
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" style="background-color:#ffffff;" width="100%">
<tbody>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td bgcolor="#fafafa"
style="background-color:#fafafa; border-top:1px solid #e1e1e1; border-left:1px solid #e1e1e1; border-right:1px solid #e1e1e1; border-bottom:1px solid #e1e1e1;"
width="90%">
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td width="24">&nbsp;</td>
<td colspan="2"
style="color:#333333; font-family:Arial, Helvetica, sans-serif; font-size:24px; line-height:26px; padding-top:18px;">
Continue...
</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="24">&nbsp;</td>
<td colspan="2"
style="color:#858585; font-family:Arial, Helvetica, sans-serif; font-size:14px; line-height:20px; padding-top:18px;">
${nick},welcome to Afrishop!Before we get started, we need to quickly verify your email address.
</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="24">&nbsp;</td>
<td colspan="2"
style="color:#858585; font-family:Arial, Helvetica, sans-serif; font-size:14px; line-height:20px; padding-top:18px;">
Your verification code is:
</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="24">&nbsp;</td>
<td colspan="2"
style="color:#858585; font-family:Arial, Helvetica, sans-serif; font-size:14px; line-height:20px; padding-top:18px;">
<span style="color:#2b9af3;text-decoration:none;font-weight:bold"
rel="noopener">${identifyCode}</a></span>
</td>
</tr>
<tr>
<td width="24">&nbsp;</td>
<td colspan="2"
style="color:#858585; font-family:Arial, Helvetica, sans-serif; font-size:14px; line-height:20px; padding-top:18px; padding-bottom:32px; border-bottom:1px solid #e1e1e1;">
By Afrishop
</td>
</tr>
</tbody>
</table>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<style type="text/css">.qmbox style, .qmbox script, .qmbox head, .qmbox link, .qmbox meta {
display: none !important;
}</style>
</body> </body>
</html> </html>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论