BUGFIX:试用时间link14天;

This commit is contained in:
shahaibo
2024-05-28 10:43:50 +08:00
parent 37de7d9276
commit 890389843f
3 changed files with 27 additions and 10 deletions

View File

@@ -136,7 +136,7 @@ public class SendEmailUtil {
private final static Long TRIAL_ORDER_LIST_ID = 122273L;
private final static Long NO_TRIAL_ORDER_LIST_ID = 122591L;
public static void sendCustomEmail(String receiverAddress, String senderAddress, TrialOrder trialOrder, int emailType, String country) {
public static void sendCustomEmail(String receiverAddress, String senderAddress, TrialOrder trialOrder, int emailType, String country, boolean link) {
try {
// 实例化一个认证对象
Credential cred = new Credential(SECRET_ID, SECRET_KEy);
@@ -173,7 +173,7 @@ public class SendEmailUtil {
}else {
template.setTemplateID(NOTIFICATION_TEMPLATE_ID);
}
template.setTemplateData(buildNotificationData(trialOrder));
template.setTemplateData(buildNotificationData(trialOrder, link));
break;
default:
break;
@@ -345,7 +345,7 @@ public class SendEmailUtil {
}
// 构建试用订单通过通知数据
private static String buildNotificationData(TrialOrder trialOrder) {
private static String buildNotificationData(TrialOrder trialOrder, boolean link) {
JSONObject jsonObject = new JSONObject();
// 设置试用订单通过通知相关数据
jsonObject.put("title", trialOrder.getTitle());
@@ -353,6 +353,11 @@ public class SendEmailUtil {
jsonObject.put("givenName", trialOrder.getGivenName());
jsonObject.put("userName", trialOrder.getUserName());
jsonObject.put("email", trialOrder.getEmail());
if (link) {
jsonObject.put("days", 14);
}else {
jsonObject.put("days", 5);
}
return jsonObject.toJSONString();
}