Hi, congratulations for this excelent boilerplate!
I want to know how to use another emailClient in dependencyInjector.ts
For instance, if I'm using Sendgrid I can replace the instance and change the DI, but also need to change the methods in MailerService. So how to make an agnostic MailerService?
Hi, congratulations for this excelent boilerplate!
I want to know how to use another emailClient in dependencyInjector.ts
For instance, if I'm using Sendgrid I can replace the instance and change the DI, but also need to change the methods in MailerService. So how to make an agnostic MailerService?
https://github.com/santiq/bulletproof-nodejs/blob/b3d82c1ef5b8e544b3c6bd2b86e3b19d4613fb31/src/loaders/dependencyInjector.ts#L15
Replace it with:
const sgInstance = sgMail;
And in the MailerService, need to change the client send method.
https://github.com/santiq/bulletproof-nodejs/blob/b3d82c1ef5b8e544b3c6bd2b86e3b19d4613fb31/src/services/mailer.ts#L23
Replace it with (sendgrid api)
this.emailClient.send(msg)
Is this right? Can you think of any other way or idea?
Thanks a lot.