refactor: modularize email processing logic and improve service structure
- Extract email template handling, rendering, and sending code into `Worker.Services` project. - Introduce `EmailTemplateService`, `EmailTemplateRenderingService`, and `SendEmailService`. - Simplify consumer logic by delegating to scoped services. - Update project dependencies and package references accordingly.
This commit is contained in:
@@ -1 +1,17 @@
|
||||
# hrynco-notification-service
|
||||
|
||||
## Notification worker flow
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A[Worker host starts] --> B[Load config and register services]
|
||||
B --> C[Start SendEmailConsumer]
|
||||
C --> D[Receive message from notification.send-email]
|
||||
D --> E[Resolve SendEmailService]
|
||||
E --> F[Pick channel and template]
|
||||
F --> G[Render email content]
|
||||
G --> H[Send via SMTP]
|
||||
H --> I[Update usage counters]
|
||||
I --> J[Optionally publish result to reply queue]
|
||||
H -. failure .-> K[Log and rethrow]
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user