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

Improve DX regarding service collection extension methods #28

Merged
merged 4 commits into from
Oct 14, 2024

Conversation

ricardoboss
Copy link
Member

It was quite cumbersome to set the default headers now that they are available. That is because to set them, you need to get ahold of the IMailClient instance that will be used to send mails. To do that, you would have to set them somewhere decoupled from the DI container registration (bad because you can' guarantee the code only runs once) or you'd have to create your own instance (basically manually constructing the client instance).

This PR changes that.

You can now pass a callback to the AddMailKitMailClient or AddSystemNetMailClient extension methods and get full access to the constructed client.

Apart from that I renamed some overloads to better match the services they register (and vice versa). No breaking changes though.

@ricardoboss ricardoboss requested a review from chucker October 14, 2024 14:12
@ricardoboss ricardoboss merged commit acd7d89 into main Oct 14, 2024
1 check passed
@ricardoboss ricardoboss deleted the devops/improved-di-usage branch October 14, 2024 14:29
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

Successfully merging this pull request may close these issues.

2 participants