✨ feat(活动): 微信公众号口令
This commit is contained in:
@@ -22,6 +22,8 @@ import { sendMessageToUserWithSuc } from "./pushService";
|
||||
import { GuildLeader } from "../domain/rank";
|
||||
import { initTaLoggingMode } from "./sdk/ta";
|
||||
import { DicPushMessage } from "../pubUtils/dictionary/DicPushMessage";
|
||||
import { GiftCodeModel } from "../db/GiftCode";
|
||||
import { GiftCodeDetailModel } from "../db/GiftCodeDetail";
|
||||
|
||||
// 检查私聊是否合法
|
||||
|
||||
@@ -319,4 +321,18 @@ export async function sendSurveyMail(code: string) {
|
||||
await sendMailByContent(MAIL_TYPE.SEND_MAIL, rec.roleId, { goods: survey.reward, params: [survey.mailContent] });
|
||||
await sendMessageToUserWithSuc(rec.roleId, PUSH_ROUTE.DELETE_SURVEY, { code: survey.code });
|
||||
rec = await SurveyRecModel.send(rec.code);
|
||||
}
|
||||
|
||||
export async function sendGiftCodeMail(message: string) {
|
||||
console.log('***** sendSurveyMail', message);
|
||||
let [roleId, _giftId] = message.split('|');
|
||||
let giftId = parseInt(_giftId);
|
||||
if(isNaN(giftId) || !roleId) return false;
|
||||
let giftCode = await GiftCodeModel.findByGiftId(giftId);
|
||||
if(!giftCode) {
|
||||
console.log('***** sendSurveyMail giftId not found', giftId);
|
||||
return false;
|
||||
}
|
||||
|
||||
await sendMailByContent(MAIL_TYPE.SEND_MAIL, roleId, { goods: giftCode.goods, params: [''] });
|
||||
}
|
||||
Reference in New Issue
Block a user