Skip to main content

SendEmail Action

Sends an email based on the contents of

This extension needs to be added to the service:

First, you will need to add the package:

dotnet add package Kadense.Malleable.Workflow.Email
dotnet add package Kadense.Malleable.Workflow.Email.AzureECS

Then add the provider and email action to your builder:

var builder = System
.AddWorkflow(workflow, malleableAssemblyList)
.AddSendEmailProvider(new AzureECSSendEmailProviderOptions()) // Add the default provider for sending emails
.AddSendEmail() // Adds the send email action
.WithDebugMode()
.Validate()

Provider Options:

NameDescriptionRequired
ConnectionStringThe connection string for the Azure ECS Service, if not populated it will look for this in the environment variable AZURE_ECS_CONNECTION_STRINGfalse
SenderThe email of the sender, if not populated it will look for the value in the environment variable EMAIL_SENDERfalse
RecipientThe email of the recipient, if not populated it will look for the value in the environment variable EMAIL_RECIPIENTfalse
SubjectThe subject line on the email, if not populated it will look for the value in the environment variable EMAIL_SUBJECTfalse
BodyHtmlThe HTML body on the email, if not populated it will look for the value in the environment variable EMAIL_BODY_HTMLfalse
BodyPlainTextThe plain text body on the email, if not populated it will look for the value in the environment variable EMAIL_BODY_PLAIN_TEXTfalse

Once you've got the provider and action added, you can add in the steps to your workflow.

Email:
action: SendEmail
nextStep: ProcessMessage
options:
parameters:
sender: >
"noreply@kadense.io"
recipient: >
"enquiries@kadense.io"
subject: >
string.Format("Receipt: {0} - Received", Input.MessageId)
bodyHtml: >
string.Format("<h1>Welcome {0}</h1><p>Just to let you know we've received your request {1} and are processing it now.</p>", Input.FirstName, Input.MessageId)
bodyHtml: >
string.Format("Welcome {0}, Just to let you know we've received your request {1} and are processing it now.", Input.FirstName, Input.MessageId)

Parameters

NameDescriptionRequired
providerThe name of the email provider to use, defaults to DefaultSendEmailProviderfalse
senderThe email of the sender, can be supplied via the options insteadfalse
receipientThe email of the recipient, can be supplied via the options insteadfalse
subjectThe subject of the email, can be supplied via the options insteadfalse
bodyHtmlThe HTML body of the email, can be supplied via the options insteadfalse
bodyPlainTextThe plain text body of the email, can be supplied via the options insteadfalse