cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

HTML Formatting Issue in Databricks Alerts

kivaniutenko
New Contributor

Hello everyone,

I have recently encountered an issue with HTML formatting in custom templates for Databricks Alerts. Previously, the formatting worked correctly, but now the alerts display raw HTML instead of properly rendered content.

For example, an alert that used to be formatted correctly now appears as plain text:

<p>Alert <b>"set_v1"</b> changed status to <span>TRIGGERED</span>.<br> Data status is <b>Data deviation: Below Lower Threshold</b></p><br><table><tbody><tr><th>day</th><th>record_count</th><th>median_record_count</th><th>mad</th><th>lower_threshold</th><th>upper_threshold</th><th>status</th></tr><tr><td>2025-02-14</td><td>14249</td><td>17296</td><td>124</td><td>16924</td><td>17668</td><td>Data deviation: Below Lower Threshold</td></tr>...

The expected behavior is that the email alert should render the HTML properly, displaying it as a formatted message rather than raw tags.

Has anyone else encountered this problem recently? Has there been a change in how Databricks processes HTML in alerts? Any workarounds or solutions would be greatly appreciated!

Thanks in advance!

1 REPLY 1

mmayorga
Databricks Employee
Databricks Employee

hi @kivaniutenko  thanks for reaching out.

Databricks alerts still support basic HTML in email templates, but HTML will render correctly only for email destinations and only with simple, allowed tags.

Quick things to try

  • Make sure you are using Alerts v2 not legacy alerts.
  • Check that the alert is still sending to an email address, not just a webhook or other integration where the content is handled as plain text. 
  • Start by temporarily setting the default template to confirm HTML is properly rendered even with this config.
  • Then change it to custom and start with a very simple body like: <p>Test <b>alert</b></p> and remove any complex HTML or CSS, then keep adding more. I tested with the static example you provided, which contains allowed tags without double encoding (&lt; or &gt;), and it worked as expected.
  • If even that simple HTML shows as text, I'd suggest opening a Databricks support ticket in the help center and sharing an example alert for further review.

I hope this helps, please let us know if it does.