3f0ead4265
- Enhanced account management with new validation and Swagger documentation. - Updated Prisma schemas and migrations for the account and profile. - Improved email handling mechanisms in the email queue system with new worker functionality. - Adjusted Docker configurations and package dependencies for better integration.
16 lines
510 B
TypeScript
16 lines
510 B
TypeScript
import { otpTemplate } from "../../templates/otpTemplate";
|
|
import sendMail from "../../utils/mail_sender";
|
|
import { TEmailQueue } from "./email.queue";
|
|
|
|
// email.processor.ts
|
|
export const emailProcessor = async (job: any) => {
|
|
const payload: TEmailQueue = job.data;
|
|
await sendMail({
|
|
to: payload.email as string,
|
|
subject: payload.subject,
|
|
htmlBody: otpTemplate(payload),
|
|
textBody: payload.textBody || "",
|
|
name: payload.name,
|
|
});
|
|
console.log("Sending email job complete:", job.id);
|
|
}; |