后台:发送邮件
This commit is contained in:
@@ -84,8 +84,13 @@ export class SendMailFun {
|
||||
let gmmail = await GMMailModel.getGmMailById(gmmailId);
|
||||
if(gmmail) {
|
||||
this.gmmail = gmmail;
|
||||
this.sendTime = gmmail.sendTime;
|
||||
this.endTime = gmmail.endTime;
|
||||
if(gmmail.useTempTime) {
|
||||
this.sendTime = gmmail.sendTime;
|
||||
this.endTime = gmmail.endTime;
|
||||
} else {
|
||||
this.sendTime = nowSeconds();
|
||||
this.endTime = this.sendTime + (gmmail.continueHour||0) * 60 * 60;
|
||||
}
|
||||
this.setParam({ ...gmmail });
|
||||
}
|
||||
}
|
||||
@@ -166,19 +171,17 @@ export class SendMailFun {
|
||||
}
|
||||
}
|
||||
|
||||
if (uids.length > 0) {//下发邮件,对应前端红点提示
|
||||
if(mailType == GM_MAIL_TYPE.SINGLE) {
|
||||
let mails = await this.createSingleMails(roleIds);
|
||||
for(let { uid, sid } of uids) {
|
||||
let mail = mails.get(uid);
|
||||
if(mail && !this.notPush) pinus.app.channelService.pushMessageByUids('onMailsAdd', resResult(STATUS.SUCCESS, { mails: [mail] }), [{ uid, sid }]);
|
||||
}
|
||||
} else if (mailType == GM_MAIL_TYPE.GROUP) {
|
||||
let mail = await this.createGroupMails(roleIds);
|
||||
if(!this.notPush) pinus.app.channelService.pushMessageByUids('onMailsAdd', resResult(STATUS.SUCCESS, { mails: [mail] }), uids);
|
||||
} else { // mailType错误
|
||||
return false;
|
||||
if(mailType == GM_MAIL_TYPE.SINGLE) {
|
||||
let mails = await this.createSingleMails(roleIds);
|
||||
for(let { uid, sid } of uids) {
|
||||
let mail = mails.get(uid);
|
||||
if(uids.length > 0 && mail && !this.notPush) pinus.app.channelService.pushMessageByUids('onMailsAdd', resResult(STATUS.SUCCESS, { mails: [mail] }), [{ uid, sid }]);
|
||||
}
|
||||
} else if (mailType == GM_MAIL_TYPE.GROUP) {
|
||||
let mail = await this.createGroupMails(roleIds);
|
||||
if(uids.length > 0 && !this.notPush) pinus.app.channelService.pushMessageByUids('onMailsAdd', resResult(STATUS.SUCCESS, { mails: [mail] }), uids);
|
||||
} else { // mailType错误
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user