|
|
|
@ -64,6 +64,25 @@ public class MailGunServiceImpl implements MailGunService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void dealDroppedNotify(String content) throws Exception {
|
|
|
|
|
String dd = URLDecoder.decode(content, "UTF-8");
|
|
|
|
|
Map<String, String> mailgunNotify = getQueryMap(dd);
|
|
|
|
|
String myData = mailgunNotify.get("my-custom-data");
|
|
|
|
|
String recipient = mailgunNotify.get("recipient");
|
|
|
|
|
if (StringUtils.isNotEmpty(myData) && StringUtils.isNotEmpty(recipient)) {
|
|
|
|
|
JSONObject tmpJSONObject = JSONObject.parseObject(myData);
|
|
|
|
|
String[] mailAddresses = recipient.split(",");
|
|
|
|
|
for (String mailAddress : mailAddresses) {
|
|
|
|
|
JSONObject record = new JSONObject();
|
|
|
|
|
record.put("id", tmpJSONObject.getString("id"));
|
|
|
|
|
record.put("mail_address", mailAddress);
|
|
|
|
|
record.put("status", 2);
|
|
|
|
|
mailSendMapper.update(record);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject sendMail(SendMail sendMail) {
|
|
|
|
|
return mailGunClient.sendMail(sendMail);
|
|
|
|
@ -131,6 +150,8 @@ public class MailGunServiceImpl implements MailGunService {
|
|
|
|
|
return mailGunClient.sendMail(sendMail);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Map<String, String> getQueryMap(String query) {
|
|
|
|
|
String[] params = query.split("&");
|
|
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
|
|