Skip to content

Commit

Permalink
feat: notify user when competition sign-up cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamerblue committed Dec 9, 2024
1 parent 3d6f3d3 commit bdfd98b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/app/competition/competition.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,17 @@ export default class CompetitionController {
this.service.clearCompetitionUserDetailCache(competitionId, userId),
this.service.clearCompetitionUsersCache(competitionId),
]);
const subject = 'Your Competition Sign-Up has cancelled';
const content = `<p>Dear User:</p>
<p>Your sign-up of competition "${detail.title}" has cancalled.</p>
<p>If this is not your operation, please re-signup or contact staff promptly.</p>
<p><br/></p>
<p>${this.siteTeam}</p>`;
const globalUser = await this.userService.findOne({ userId });
// 发送邮件通知
globalUser?.email && this.mailSender.singleSend(globalUser.email, subject, content);
// 发送站内信
this.messageService.sendSystemMessage(userId, subject, content);
this.competitionLogService.log(competitionId, ECompetitionLogAction.DeleteSelfParticipantInfo, {
userId,
});
Expand Down

0 comments on commit bdfd98b

Please sign in to comment.