【7.2.3】更新C端业务是否开启发送邮件的标识

pull/30/head
fengshuonan 2022-06-28 15:56:38 +08:00
parent f9437e510b
commit 541d44fda3
2 changed files with 24 additions and 8 deletions

View File

@ -91,4 +91,16 @@ public class CustomerConfigExpander {
return ConfigContext.me().getSysConfigValueWithDefault("CUSTOMER_OPEN_OLD_PASSWORD_VALIDATE", Boolean.class, Boolean.FALSE);
}
/**
*
* <p>
*
*
* @author fengshuonan
* @date 2022/6/28 15:38
*/
public static boolean getSendEmailFlag() {
return ConfigContext.me().getSysConfigValueWithDefault("SYS_CUSTOMER_SEND_EMAIL", Boolean.class, true);
}
}

View File

@ -129,6 +129,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
this.save(regCustomer);
// 发送邮箱验证码
if (CustomerConfigExpander.getSendEmailFlag()) {
try {
SendMailParam regEmailParam = CustomerFactory.createRegEmailParam(regCustomer.getEmail(), regCustomer.getVerifyCode());
mailSenderApi.sendMailHtml(regEmailParam);
@ -138,6 +139,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
}
}
}
}
@Override
public void active(CustomerRequest customerRequest) {
@ -251,9 +253,11 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
this.updateById(customer);
// 发送邮箱验证码
if (CustomerConfigExpander.getSendEmailFlag()) {
SendMailParam resetPwdEmail = CustomerFactory.createResetPwdEmail(customerRequest.getEmail(), randomCode);
mailSenderApi.sendMailHtml(resetPwdEmail);
}
}
@Override
public void resetPassword(CustomerRequest customerRequest) {