Jump to content

Minor "problem": wrong format of notification mails


MAM59

Recommended Posts

See:


Subject: Unraid Status: [F] Unsauberes Herunterfahren erkannt
MIME-Version: 1.0
X-Mailer: PHP/8.2.7
Content-type: text/plain; charset=utf-8
From: [email protected]
Reply-To: [email protected]

Event: Parity Check Tuning
Subject: [F] Unsauberes Herunterfahren erkannt
Description: See <b>Troubleshooting</b> section of online documentation for guidance on resolving this
Importance: alert

Message claims to be "text/plain" but uses formats like <b>. One of these infos is wrong.

(I think, the formats should be filtered out)

 

Link to comment

Hi @itimpi would you please remove HTML from the notifications from the Parity Check Tuning plugin? They are meant to be text only.

 

I'd suggest using markdown formatting instead. I'm not sure if markdown in notifications would be rendered as html in the webgui, but markdown itself is pretty readable. This will prevent issues with emails that are sent as well as with notification agents that aren't expecting to get HTML.

Link to comment
11 minutes ago, ljm42 said:

I'd suggest using markdown formatting instead. I'm not sure if markdown in notifications would be rendered as html in the webgui, but markdown itself is pretty readable.


I DID use markdown 😊.  That allowed me to bolden part of the notification when displayed via the web GUI.  It is obviously not being passed through transparently to the other notification agents.    I can remove it but it is a shame that I need to 😒

  • Like 1
Link to comment
25 minutes ago, itimpi said:

I DID use markdown 😊.  That allowed me to bolden part of the notification when displayed via the web GUI.  It is obviously not being passed through transparently to the other notification agents.    I can remove it but it is a shame that I need to 😒

 

Interesting : )

 

When I pass markdown to the notify script directly:

/usr/local/emhttp/webGui/scripts/notify -e "My Event" -s "My Subject" -d 'See **Troubleshooting** section of online documentation for guidance on resolving this'  -m "My Message" -i "alert" -l "/Dashboard"

 

It comes through the email as markdown, so I'm pretty confident the notification system is not converting it to HTML

image.png

 

I see where you are defining the string using markdown as `**Troubleshooting**`:

https://github.com/itimpi/parity.check.tuning/blob/800138c7ac56b25bba0d6fdc7b9ca4e1e1c75606/source/usr/local/emhttp/plugins/parity.check.tuning/parity.check.tuning.php#L634

But I think something (maybe the translation system?) is converting the markdown to HTML before it is passed to to the notify script

 

Link to comment
28 minutes ago, ljm42 said:

But I think something (maybe the translation system?) is converting the markdown to HTML before it is passed to to the notify script

 

I guess it could be that.   Probably means there is no practical way to avoid that if that is the cause as I would think the phrase going through the translation system is important.

 

Interesting how much aggravation is being caused by what is just meant to be a helpful message to help end users, and is not at all critical to my plugin's functionality is causing :) 

 

Link to comment

Ahhh, folks, there is another glitch like above, but not in the mail. instead the gui is wrong too:

 

grafik.thumb.png.9ec091ec998e6a148debb34d77e3a83a.png

"WAN-IP ist <b>..."

I bet this is the same problem like above. But the GUI is html, so the "<b>" needs to be escaped somewhere.

(yeah I know, this is my current public address, but UNRAID is not reachable from the internet, so I don't care)

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...