chore: add new method for sms service and notification service

This commit is contained in:
mahyargdz
2025-05-04 12:27:21 +03:30
parent 8fe1d398a6
commit 3d24cee972
10 changed files with 451 additions and 8 deletions
@@ -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");
}
}
}