mirror of
https://github.com/certd/certd.git
synced 2026-04-23 11:37:23 +08:00
perf: 支持邮件模版设置
This commit is contained in:
@@ -21,10 +21,23 @@ export class EmailNotification extends BaseNotification {
|
||||
receivers!: string[];
|
||||
|
||||
async send(body: NotificationBody) {
|
||||
await this.ctx.emailService.send({
|
||||
subject: body.title,
|
||||
content: body.content + '\n\n[查看详情](' + body.url + ')',
|
||||
receivers: this.receivers,
|
||||
});
|
||||
|
||||
const templateData = {
|
||||
...body,
|
||||
}
|
||||
await this.ctx.emailService.sendByTemplate({
|
||||
type: body.notificationType,
|
||||
data: templateData,
|
||||
email: {
|
||||
receivers: this.receivers,
|
||||
attachments: body.attachments,
|
||||
}
|
||||
})
|
||||
|
||||
// await this.ctx.emailService.send({
|
||||
// subject: body.title,
|
||||
// content: body.content + '\n\n[查看详情](' + body.url + ')',
|
||||
// receivers: this.receivers,
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user