feat: expose email address in email templates
This commit is contained in:
@@ -10,11 +10,16 @@ export const worker = new Worker(
|
|||||||
async (job) => {
|
async (job) => {
|
||||||
const { email, subject, template, params } = job.data;
|
const { email, subject, template, params } = job.data;
|
||||||
|
|
||||||
|
const emailTemplateParams = {
|
||||||
|
...params,
|
||||||
|
email,
|
||||||
|
}
|
||||||
|
|
||||||
await mailer.sendMail({
|
await mailer.sendMail({
|
||||||
to: email,
|
to: email,
|
||||||
from: appConfig.fromEmail,
|
from: appConfig.fromEmail,
|
||||||
subject: subject,
|
subject: subject,
|
||||||
html: compileEmail(template, params),
|
html: compileEmail(template, emailTemplateParams),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
{ connection: redisConfig }
|
{ connection: redisConfig }
|
||||||
|
Reference in New Issue
Block a user