How can I embed an image into a Dynamics email in Power Automate?

Getting Power Automate to create an email record in Dynamics with an embedded image can be tricky.

Applies to:

  • Dynamics 365 On-Prem

  • Dynamics 365 On-line


Here’s the scenario. I had a client who needed emails to be created in Dynamics (as Dynamics records) so that they could be approved and sent out. In this request he added that I embed an image - in this case it was a ‘Your application is at Stage 2!’

The challenge is, that adding HTML to the record in the Body field can have some unpredictable results.


The HTML

After breaking out and dusting off my HTML books I realized they were horrifically out of date - so I turned to Google.

By making use of the DIV tags, and writing the whole email as HTML, the desired effect was achieved.

 

Sample Code

Here is a very basic version of the email I built';

 <div data-wrapper="true" style="font-size: 9pt; font-family: Segoe UI, Helvetica Neue, sans-serif; direction: ltr;">

<div><h1>Congratulations!</h1> </div>

<div><p>We're moving to stage two. Up next we'll be asking for additional information</p></div>

<div><img align="none" height="196" src="https://testimage.com/testimage.png" style="width:200px;height:196px;" width="200"></div>

<div><p>We're moving to stage two. Up next we'll be asking for additional information</p></div>

<div><p>More info goes here...</p></div>

</div>

You can continue to develop the email and add variables or record data to personalize the email as needed.


Photo by Solen Feyissa from Pexels

Previous
Previous

Which Dynamics workflow is doing this?

Next
Next

Tips for Choosing a CRM - Part 5 - Position for Success