Conditional Workflow Email Content in Dynamics 365

Megha Kainth, 19 July 2019

In this blog, I will show you how you can add conditional email content when sending email messages via workflow in Dynamics 365.

In this scenario, we want to send an automated email, but sign off the email based on information from a Case record. For example, if the Case Type = “Enquiry”, sign off with “From the Enquiries Team” and if the Case Type = “Product”, sign off with “From the Products Team”.

First, we build our main workflow which will send the email. We start with a check to ensure that the customer has an email address, and then call an Action (called “Email Sign Off”) which will figure out the right email content to use.

image

image

image

The Action takes in the Case reference as a parameter and simply checks the Case Type field and sets an output parameter using the “Assign Value” step.

image

image

The screenshot below is what the Action looks like after we’ve added all necessary conditions.

image

We can use the result from the Action in the “Send Email” step of our workflow, as shown below. The {Result(Generate Email Sign Off)} placeholder references the output parameter of the Action.

image

When testing the Workflow where Case Type = “Product”, we end up with the following email message which uses the correct text in the email sign off.

image