mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
feat(api): log mailer when sending email (#59065)
This commit is contained in:
@@ -35,10 +35,12 @@ const plugin: FastifyPluginCallback<{ provider: MailProvider }> = (
|
||||
)
|
||||
);
|
||||
|
||||
fastify.decorate(
|
||||
'sendEmail',
|
||||
async (args: SendEmailArgs) => await provider.send(args)
|
||||
);
|
||||
fastify.decorate('sendEmail', async (args: SendEmailArgs) => {
|
||||
const logger = fastify.log.child({ args });
|
||||
logger.debug('Sending Email');
|
||||
|
||||
return await provider.send(args);
|
||||
});
|
||||
|
||||
done();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user