Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email client replacement #104

Open
jcruzmontanari opened this issue Jun 17, 2021 · 1 comment
Open

Email client replacement #104

jcruzmontanari opened this issue Jun 17, 2021 · 1 comment

Comments

@jcruzmontanari
Copy link

jcruzmontanari commented Jun 17, 2021

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?

const mgInstance = new Mailgun(formData);

Replace it with:

const sgInstance = sgMail;

And in the MailerService, need to change the client send method.

this.emailClient.messages.create(this.emailDomain, data);

Replace it with (sendgrid api)

this.emailClient.send(msg)

Is this right? Can you think of any other way or idea?

Thanks a lot.

@elemanhillary
Copy link

thats all you need unless there's more you want to provide to StartEmailSequence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants