Tue, 03/30/2021 - 11:38 By Nguyen Van Hao

CSS code within D365 Email Template

As you know, Dynamics 365 has a WYSIWYG editor in the email template. Sometimes you need to add complex HTML + CSS code to the template (for example, create a beautiful background for the email template)

Let's see how to do it ! 

Step 1: create a HTML template with HTML + CSS code

Open Settings \ Templates \ Email Templates

Create new email template

CSS code within D365 Email Template
Email template mix HTML + CSS + Dynamics content

Step 2: create new email and insert email template to an email

CSS code within D365 Email Template
Create new email from template

 

         CSS code within D365 Email Template

Limitations

  1. Using image: you need to use a public image url in the email template or use a image data in base 64 format
    <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAB..."> But be carefull of the size of your content when using a base64 intrated image ! 
  2. Using CSS: you can use inline css only in email template
  3. HTML tag: not all HTML tags are support in the email template (for example the iframe tag is not support)

Conclusion

We can insert HTML code + CSS in email template. This is "hidden" feature. Microsoft doesn't explicity document this feature but we can use it. There are some limitations when using HTML code in email template (see detail in section "Limitations")

CSS code within D365 Email Template

Add new comment

Image CAPTCHA
Enter the characters shown in the image.