支付优化

This commit is contained in:
2024-11-19 17:08:16 +08:00
parent f6f759110f
commit 4d756d5624
4 changed files with 23 additions and 18 deletions

View File

@@ -782,7 +782,8 @@ public class SendEmailUtil {
public static void subscriptionEmailReminder(String type, SubscriptionEmailParamsDTO subscriptionEmailParamsDTO, String language, String receiverAddress){
try{
String kimEmail = "kimwong@code-create.com.hk";
// String merchantEmail = "kimwong@code-create.com.hk";
String merchantEmail = "xupei3360@163.com";
Credential cred = new Credential(SECRET_ID, SECRET_KEy);
// 实例化一个http选项可选的没有特殊需求可以跳过
HttpProfile httpProfile = new HttpProfile();
@@ -798,7 +799,7 @@ public class SendEmailUtil {
user.setDestination(new String[]{receiverAddress});
SendEmailRequest merchant = new SendEmailRequest();
merchant.setFromEmailAddress(SEND_ADDRESS);
merchant.setDestination(new String[]{kimEmail});
merchant.setDestination(new String[]{merchantEmail});
Template templateUser = new Template();
Template templateMerchant = new Template();
switch (type) {
@@ -848,12 +849,15 @@ public class SendEmailUtil {
templateMerchant.setTemplateData(JSON.toJSONString(subscriptionEmailParamsDTO));
merchant.setTemplate(templateMerchant);
// 返回的resp是一个SendEmailResponse的实例与请求对象对应
SendEmailResponse respUser = client.SendEmail(user);
// todo 暂时先不发商家邮件
// SendEmailResponse respMerchant = client.SendEmail(merchant);
log.info("邮件发送结果toUser###{}", SendEmailResponse.toJsonString(respUser));
// log.info("邮件发送结果toMerchant###{}", SendEmailResponse.toJsonString(respMerchant));
if (!type.equals("cancel")){
// 返回的resp是一个SendEmailResponse的实例与请求对象对应
SendEmailResponse respUser = client.SendEmail(user);
log.info("邮件发送结果toUser###{}", SendEmailResponse.toJsonString(respUser));
}
if (!type.equals("reminder")){
SendEmailResponse respMerchant = client.SendEmail(merchant);
log.info("邮件发送结果toMerchant###{}", SendEmailResponse.toJsonString(respMerchant));
}
} catch (TencentCloudSDKException e) {
log.info("邮件发送失败###{}", e.toString());
throw new BusinessException("failed.to.send.mail");