master
wangning 7 years ago
parent 9126519dcf
commit b34e6b8f3c

@ -818,6 +818,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
SendMail sendMail = new SendMail();
Set<String> to = new HashSet<>();
to.add(mailTo);
sendMail.setFrom("postmaster@dev.showcodes.com");
sendMail.setMailTos(to);
sendMail.setMailCcs(emails);
sendMail.setTitle("Your RoyalPay Cross-border Payment has been set up");
@ -872,6 +873,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
Set<String> to = new HashSet<>();
to.add(mailTo);
sendMail.setMailTos(to);
sendMail.setFrom("postmaster@dev.showcodes.com");
sendMail.setMailCcs(emails);
sendMail.setTitle("Your Partner Account Has Been Authenticated Successfully");
sendMail.setContent(content);

@ -309,18 +309,14 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
// final String content = VelocityEngineUtils.mergeTemplateIntoString(null, "mail/reset_password.vm",
// "utf-8", map);
new Thread(() -> {
try {
SendMail sendMail = new SendMail();
Set<String> to = new HashSet<>();
to.add(contact_email);
sendMail.setMailTos(to);
sendMail.setFrom("postmaster@dev.showcodes.com");
sendMail.setTitle("Reset Password");
sendMail.setContent(content);
mailService.sendMail(sendMail);
} catch (Exception ignored) {
}
}).start();
return contact_email;
@ -372,4 +368,5 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
account.put("is_password_expired", 0);
clientAccountMapper.update(account);
}
}

@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.net.URLDecoder;
@ -28,6 +29,10 @@ public class MailGunServiceImpl implements MailGunService {
@Resource
private MailGunClient mailGunClient;
@Value("${mail.mailgun.default.merchantlist}")
private String mailListDefault;
@Override
public void dealNotify(String nofityString) throws Exception {
String dd = URLDecoder.decode(nofityString, "UTF-8");
@ -59,7 +64,7 @@ public class MailGunServiceImpl implements MailGunService {
JSONObject var = new JSONObject();
var.put("client_moniker", client.getString("client_moniker"));
var.put("short_name", client.getString("short_name"));
result = mailGunClient.addListMember(client.getString("contact_email"),"merchants",client.getString("contact_person"),var);
result = mailGunClient.addListMember(client.getString("contact_email"),mailListDefault,client.getString("contact_person"),var);
}catch (Exception ignore){
logger.info("add Mail List Failed email:"+client.getString("contact_email")+" client_moniker:"+client.getString("client_moniker"));
}
@ -73,7 +78,7 @@ public class MailGunServiceImpl implements MailGunService {
JSONObject var = new JSONObject();
var.put("client_moniker", newClient.getString("client_moniker"));
var.put("short_name", newClient.getString("short_name"));
result = mailGunClient.updateClientOfMailList(newClient.getString("contact_email"),"merchants",newClient.getString("contact_person"),oldClient.getString("contact_email"),var);
result = mailGunClient.updateClientOfMailList(newClient.getString("contact_email"),mailListDefault,newClient.getString("contact_person"),oldClient.getString("contact_email"),var);
}catch (Exception ignore){
logger.info("Modify Mail List Failed oldEmail:"+oldClient.getString("contact_email")+" client_moniker:"+newClient.getString("client_moniker") + " newEmail:"+newClient.getString("contact_email"));
}

@ -101,4 +101,6 @@ app.ofei.pwd=aomi@8888
app.ofei.sp-code=A1407200
mail.mailgun.api_key=api:key-96fa3b5866ace125b8ec5a9d27e19353
mail.mailgun.domain=dev.showcodes.com
mail.mailgun.default.merchantlist=info@dev.showcodes.com

@ -154,6 +154,7 @@ public class CustomerImpressionImplTest {
@Test
public void sendSimpleMessages() throws Exception {
SendMail sendMail = new SendMail();
sendMail.setFrom("postmaster@dev.showcodes.com");
sendMail.setContent("<html><p>Hi kira</p ></html>");
Set<String> mailCCs = new HashSet<>();
mailCCs.add("164851225@qq.com");

Loading…
Cancel
Save