ita-social-projects / OoS-Backend

Out of School: The platform for choosing an extracurricular activity for your children
MIT License
13 stars 6 forks source link

Tkach/refactor email sender #1588

Closed jimmy2jk closed 2 weeks ago

jimmy2jk commented 4 weeks ago

Sumary of issue

EmailSenderJob had a dependancy on SendGridClient and so in dev environment emails could not be logged to debug console.

Summary of change

Added IEmailSender interface and two implementations:

EmailSenderJob now depends on IEmailSender instead of SendGridClient. Delete DevEmailSender as it's responsibility now implemented by DevelopmentEmailSender. Registration of appropriate email sender is based on environment. Split registration of EmailSenderService and EmailSenders into different extension methods. Adjust existing unit tests to work correctly with made changes and cover new senders with unit tests.

sonarcloud[bot] commented 4 weeks ago

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
86.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud