Menu Close

Customize SCOM HTML based email alert formatting

One of the new features in SCOM 2019 and later is HTML based emails.

This is great – because they are much more attractive and configurable over the previous plain text.

image

 

SCOM 2016 and earlier alerts:

 

image

 

Has plain text email like this:

image

 

This same email in SCOM 2019 and later:

image

 

Looks great right???

Almost.

A big complaint here is that the Alert Description now shows up as one big blob of text, in HTML format.  The line breaks are not honored and this is very hard to read.

The cool thing about HTML, is that you have a LOT of control over how things are presented visually, and the SCOM HTML supports CSS controls.

A simple change the in the SCOM Notification Channel from this line:

<b>Alert description:</b> $Data[Default='Not Present']/Context/DataItem/AlertDescription$<br />

To this:

<div style="white-space: pre"><b>Alert description:</b> $Data[Default='Not Present']/Context/DataItem/AlertDescription$<br /></div>

and our emails will format exactly as they are seen in the console:

image

 

image

 

6 Comments

    • Kevin Holman

      You use the copy button, then copy the entire thing to notepad, make your edits – then copy and use the paste button. You cannot directly edit.

  1. Sandro

    Hi Kevin
    We made the changes in our environment (SCOM2019) but the mail format is still “ugly” 🙁 do we have to restart some services or other workarounds?

    • Kevin Holman

      No – you don’t need to. How odd. Are you should you made changes to the SMTP channel that the subscription is using?

      Also – is the alert description “ugly” in the console too?

      • Sandro

        yes, we only have one SMTP channel.
        in the scom-console itself, the description-field looks fine. its only the mail-output that is still broken…

        • Sandro

          ok, it seems that our local SMTP-server has something to do with. if i configured the SMTP directly to Exchange Online then the format is working….

Leave a Reply

Your email address will not be published.