chore: add new method for sms service and notification service
This commit is contained in:
@@ -153,4 +153,23 @@ export class EmailService {
|
||||
this.logger.error("error in sending payment cancellation email", error);
|
||||
}
|
||||
}
|
||||
|
||||
async sendAdminNotificationEmail(data: { userEmail: string; title: string; message: string }) {
|
||||
const emailData = {
|
||||
to: data.userEmail,
|
||||
subject: data.title,
|
||||
template: "admin-notification",
|
||||
context: {
|
||||
title: data.title,
|
||||
message: data.message,
|
||||
},
|
||||
};
|
||||
|
||||
try {
|
||||
await this.mailerService.sendMail(emailData);
|
||||
} catch (error) {
|
||||
this.logger.error("error in sending admin notification email", error);
|
||||
throw new InternalServerErrorException("error in sending admin notification email");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user