Browse Source

邮件发送产品名称更新

Bob 1 year ago
parent
commit
9cfa309a74

+ 2 - 1
pdf-tech-core/src/main/java/cn/kdan/pdf/tech/core/service/impl/VppDeviceServiceImpl.java

@@ -162,7 +162,8 @@ public class VppDeviceServiceImpl implements VppDeviceService {
                 Products product = productService.getById(subscriptions.getProductId());
                 String helpLink = vppLicenseCodeServiceImpl.getHelpLink(product.getCode());
                 String devicesModel = StringUtils.isNotEmpty(model) ? model : "";
-                String text = String.format(CaptchaActionEnum.CANCEL_DEVICE_ASSIGN.text(),vppMember.getEmail(),devicesModel,product.getName(),product.getName(),devicesModel, helpLink);
+                String productName = ProductNameEnum.getEnumByDatabaseName(product.getName()).viewName();
+                String text = String.format(CaptchaActionEnum.CANCEL_DEVICE_ASSIGN.text(),vppMember.getEmail(),devicesModel,productName,productName,devicesModel, helpLink);
                 // 替换图片动态地址和取消订阅链接
                 text = text.replace("emailImagesUrl", emailImagesUrl).replace("cancelEmailUrl", readerproUrl + "/unsubscribe?email=" + vppMember.getEmail());
                 emailUtils.sendMail(CaptchaActionEnum.CANCEL_DEVICE_ASSIGN.subject(), text, Collections.singletonList(vppMember.getEmail()));

+ 3 - 3
pdf-tech-core/src/main/java/cn/kdan/pdf/tech/core/service/impl/VppLicenseCodeServiceImpl.java

@@ -233,7 +233,7 @@ public class VppLicenseCodeServiceImpl implements VppLicenseCodeService {
                         "                 </tr>";
                 for (LicenseCodes code : codes) {
                     Products product = productService.getById(code.getProductId());
-                    productName = productName + product.getName() + "<br/>";
+                    productName = productName + ProductNameEnum.getEnumByDatabaseName(product.getName()).viewName() + "<br/>";
                     cdKey = cdKey + code.getCdkey() + "<br/>";
                     if (product.getCode().contains("platform")) {
                         platformType = 3;
@@ -380,7 +380,7 @@ public class VppLicenseCodeServiceImpl implements VppLicenseCodeService {
         vppDeviceService.unBindByMemberId(null, Collections.singletonList(vppLicenseCode.getCdkey()));
         // 发送邮件
         ThreadPoolSingleUtil.getInstance().excute(() -> {
-            String text = String.format(CaptchaActionEnum.CANCEL_LICENSE_ASSIGN.text(), vppMember.getEmail(), products.getName(), products.getName(), user.getEmail());
+            String text = String.format(CaptchaActionEnum.CANCEL_LICENSE_ASSIGN.text(), vppMember.getEmail(), ProductNameEnum.getEnumByDatabaseName(products.getName()).viewName(), products.getName(), user.getEmail());
             // 替换图片动态地址和取消订阅链接
             text = text.replace("emailImagesUrl", emailImagesUrl).replace("cancelEmailUrl", readerproUrl + "/unsubscribe?email=" + vppMember.getEmail());
             emailUtils.sendMail(CaptchaActionEnum.CANCEL_LICENSE_ASSIGN.subject(), text, Collections.singletonList(vppMember.getEmail()));
@@ -474,7 +474,7 @@ public class VppLicenseCodeServiceImpl implements VppLicenseCodeService {
                     log.info("发送邮件前{}", DateUtil.date().toString("yyyy-MM-dd HH:mm:ss:SSS"));
                     // 发送邮件
                     ThreadPoolSingleUtil.getInstance().excute(() -> {
-                        String text = String.format(CaptchaActionEnum.CANCEL_LICENSE_ASSIGN.text(), vppMember.getEmail(), product.getName(), product.getName(), user.getEmail());
+                        String text = String.format(CaptchaActionEnum.CANCEL_LICENSE_ASSIGN.text(), vppMember.getEmail(), ProductNameEnum.getEnumByDatabaseName(product.getName()).viewName(), product.getName(), user.getEmail());
                         // 替换图片动态地址和取消订阅链接
                         text = text.replace("emailImagesUrl", emailImagesUrl).replace("cancelEmailUrl", readerproUrl + "/unsubscribe?email=" + vppMember.getEmail());
                         emailUtils.sendMail(CaptchaActionEnum.CANCEL_LICENSE_ASSIGN.subject(), text, Collections.singletonList(vppMember.getEmail()));