This component handles the functionality related to sending an email through Altinn Notifications.
This is a backend WebAPI solution written in .NET / C# following the clean architecture principles. The solution is into three projects, each with their associated test project.
The API layer that consumes services provided by Altinn.Notifications.Email.Core
Relevant implementations:
- Program.cs
- Kafka consumer implementation
The domain and application layer that implements the business logic of the system.
Relevant implementations:
- Interfaces for external dependencies implemented by infrastructure layer
- Domain models
- Services for handling sending of e-mails
The infrastructure layer that implements the interfaces defined in Altinn.Notifications.Email.Core for integrations towards 3rd-party libraries and systems.
Relevant implementations:
- Client for integrating with e-mail service
- Kafka producer implementation
- .NET 9.0 SDK
- Newest Git
- A code editor - we like Visual Studio Code
- Also install recommended extensions (e.g. C#)
- Podman or another container tool such as Docker Desktop
Clone Altinn Notifications Email repo and navigate to the folder.
git clone https://github.com/Altinn/altinn-notifications-email
cd altinn-notifications-email
Ensure that Docker and Podman are installed and is running.
In a terminal navigate to the root of this repository
and run command podman compose -f setup-kafka.yml up -d
Kafdrop is now available at http://localhost:9000.
If you need working end to end functionality when working on Notifications Email Azure Communication Services (ACS) needs to be set up.
Set up a service in your personal Azure account or use an existing service in a test environment. Find the connection string in the Azure Portal under Settings -> Keys and add this to the configuration values.
We recommend settings it up as a user secret with the commands below.
cd src Altinn.Notifications.Email
dotnet user-secrets init
dotnet user-secrets set "CommunicationServicesSettings:ConnectionString" "insert-connection-string"
The Notifications Email component can be run locally when developing/debugging. Follow the install steps above if this has not already been done.
-
Navigate to src/Altinn.Notifications.Email, and build and run the code from there, or run the solution using you selected code editor
cd src/Altinn.Notifications.Email dotnet run