Where to put notification templates in Domain Driven Design?

I have a project with four layers: Domain Application Infrastructure Presentation I have an email service interface in the Application layer. It takes an interface parameter called INotificationTemplate, which has a method that returns a list of paragraphs for the body of the notification sent by the email service. The classes implementing INotificationTemplate are currently in the Application layer. Each class corresponds to a specific event, such as "Case Creation" or "Calendar Event Update." My main question is, should classes implementing INotificationTemplate be in the Domain layer instead?

Feb 6, 2025 - 10:11
 0
Where to put notification templates in Domain Driven Design?

I have a project with four layers:

  1. Domain
  2. Application
  3. Infrastructure
  4. Presentation

I have an email service interface in the Application layer. It takes an interface parameter called INotificationTemplate, which has a method that returns a list of paragraphs for the body of the notification sent by the email service.

The classes implementing INotificationTemplate are currently in the Application layer. Each class corresponds to a specific event, such as "Case Creation" or "Calendar Event Update."

My main question is, should classes implementing INotificationTemplate be in the Domain layer instead?