< Previous Challenge - Home - Next Challenge >
In this challenge, you’re going to use a Dapr output binding in the FineCollectionService
to send an email.
Dapr offers a bindings building block to easily interface with external systems. Bindings are divided into input bindings and output bindings. Input bindings trigger your services by picking up events from external systems. Output bindings are an easy way to invoke functionality of an external system. Both input and output bindings work without the developer having to learn the API or SDK of the external system. You only need to know the Dapr bindings API. See below for a diagram of how output bindings work:
For this hands-on challenge, you will add an output binding leveraging the Dapr binding building block. For detailed information, read the introduction to this building block in the Dapr documentation and the bindings chapter in the Dapr for .NET developers guidance eBook.
You will need to modify the services to use the Dapr SMTP output bindings.
FineCollectionService
(CollectionController
class) so that it uses the Dapr SMTP output binding to send an email.Simulation
application.This challenge targets the operation labeled as number 4 in the end-state setup:
Local
Azure
FineCollectionService
has been modified so that it uses the Dapr sidecar to send out email via an output binding.docker run -d -p 4000:1080 -p 4025:1025 --name dtc-maildev maildev/maildev:latest
FineCollectionService/Helpers/EmailUtils.cs
file for a helper class to construct the email.emailFrom
vs. EmailFrom
, emailTo
vs. EmailTo
, subject
vs. Subject
)