All APIM email notifications failing — “Provided template body is not a well-formed HTML document

Mallelin Bolufe 0 Reputation points
2025-06-19T17:36:57.7866667+00:00

Hello Microsoft Support,

We are experiencing an issue where none of the email notifications in Azure API Management (APIM) are being sent — this includes all default notification types (sign-up confirmations, subscription requests, etc.).

When reviewing the notification templates in the Azure Portal under Notifications > Templates, we consistently receive the following error in all of our templates:

"Provided template body is not a well-formed HTML document" User's image

<!DOCTYPE html>
<html lang="en">
  <head>
  </head>
  <body>
    <p style="font-size:12pt;font-family:'Segoe UI'">Dear $DevFirstName $DevLastName,</p>
    <p style="font-size:12pt;font-family:'Segoe UI'">
      Thank you for your interest in our <strong>$ProdName</strong> API product!
    </p>
    <p style="font-size:12pt;font-family:'Segoe UI'">
      We were delighted to receive your subscription request. We will promptly review it and get back to you at <strong>$DevEmail</strong>.
    </p>
    <p style="font-size:12pt;font-family:'Segoe UI'">Thank you,</p>
    <p style="font-size:12pt;font-family:'Segoe UI'">The $OrganizationName API Team</p>
    <p><a style="font-size:12pt;font-family:'Segoe UI'" href="http://$DevPortalUrl">$DevPortalUrl</a></p>
  </body>
</html>

However, we’ve validated the HTML for multiple templates using W3C and other HTML validators and confirmed that:

The templates contain complete, well-structured HTML documents (<!DOCTYPE html>, <html>, <head>, <body>)

No syntax issues, broken tags, or empty elements are present

What we’ve done so far:

  • Verified SMTP settings are correctly configured under Notifications > Email
  • Enabled diagnostic logs, but AzureDiagnostics shows no log entries for email or notification-related activity

Our Questions:

  1. What conditions might cause the “not a well-formed HTML document” error even when the HTML is valid?
  2. Is there any internal validation mechanism in APIM that might be rejecting standard HTML5 syntax (e.g., <meta charset="UTF-8">, <head></head>)?
  3. Could there be a regression or platform-side validation issue affecting all templates?
  4. Is there a way to obtain deeper diagnostic logs or traces showing template rendering or notification delivery attempts?

Any guidance or escalation would be greatly appreciated, as this issue is blocking all APIM-generated communication.

Thank you

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,453 questions
{count} votes

1 answer

Sort by: Newest
  1. Mallelin Bolufe 0 Reputation points
    2025-07-02T16:02:32.5933333+00:00

    We confirmed with the Microsoft product group that the email validation error is a known bug, and a fix is already being rolled out. They’ve applied a patch across the Government Cloud. While I’m still seeing the error message, the good news is that we’re now receiving email notifications.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.