Hi,
We have just enabled Email Lightning Builder and are facing deliverability issues. We have sent several emails to internal and external addresses which are being hard bounced because of a DKIM failure. We have used public online tools to analyse the email and the validation error may be related to the body hash and the email encoding. The error message reads:
DKIM Results: fail (wrong body hash)
We have also tried to send emails with the defaults components only (rich text and unsubscribe) and the results were the same.
Any idea what is causing this failure?
After further investigation, the deliverability issue appears to stem from the Email preheader element.
More specifically, Pre-headers created using the Lightning Builder component contain a <div> entity with contentpage_emailContentPreheader" that also contains lots of HTML entities representing whitespace ( , non-breaking space) and a non-printing character, ZWNJ (zero-width non-joiner), "hidden" between each of them.
These HTML elements seem to affect the hashing of the email leading to DMARC validation failures. (although this aspect warrants more investigation)
By leaving the preheader element empty, the emails are successfully delivered and pass the DMARC validation.
As a workaround, rather than generating preheaders using the built-in Preheader textbox, Salesforce recommends to add an HTML content block before any other builder content, containing an "invisible" <div> as shown below:
<div style="display:none; visibility: hidden; font-size: 1px; line-height: 1px; max-height: 0px; max-width: 0px; opacity: 0; overflow: hidden; mso-hide: all; font-family: sans-serif;">Desired preheader text</div>
That allows to use preheaders while avoiding the addition of all the extraneous ZWNJ characters to the content.
Many thanks to @Naima Bouri for her helpful investigation!