Microsoft Flow: Send Email with Email Signature

By | June 15, 2019

One of my client has a business process in place that if a case is awaiting for customer response, and no response is received within a week, then customer agent close the case as resolved. Few days back while I was in discussion with client, I received requirement that when a case is resolved by customer care agent, an email should be sent to customer to inform .  The email sent from “Customer Care” email address (a special queue/mailbox) must have (email) signature attached. As MS flow is a great tool to automate processes and will eventually replace workflows, so I decided to go with using MS Flow to achieve the functionality.

To demonstrate how I achieve the functionality using trial CE environment, I created an email signature record:

 

Email Signature

Email Signature

The above email signature is used in MS flow to send email.

Step by step explanation of flow:

Step 1: The flow will be triggered on updated of Case:

Step 2: In second step, check for the status of the case to make sure it is “Problem Solved”.

 

Step 3: If condition in step 2 is true, then the email signature record is retrieved:

As “EmailSignatures” is a list records control, the MS Flow editor will add “apply to each” control itself. So, I didn’t tried to change as it worked fine. The “presentationxml” field of “Email Signature” entity will contain the body of the (body) of the signature:

“presentationxml”: “<emailsignature><presentationxml>&lt;div&gt;Muhammad Salahuddin&lt;/div&gt;&lt;div&gt;Senior CRM Consultant&lt;/div&gt;&lt;div&gt;&lt;img class=\”irc_mi\” src=\”https://geekflare.com/nexus/wp-content/uploads/2018/08/htmlsig.png\” alt=\”Related image\” style=\”margin-top: 113px;\” data-iml=\”1559416122236\” width=\”128\” height=\”128\”&gt;&lt;/div&gt;</presentationxml></emailsignature>”,

 

Step 4: The presentationxml field stores the data in xml format and the “presentationxml” node holds the signature. To get the signature body/text from the node, I have used the “xpath” expression:

xpath(xml(item()[‘presentationxml’]), ‘string(emailsignature/presentationxml)’)

Step 5: Use the expression in the body of Email in “Send an Email” control:

The signature in email will look: