User Notification HTML Support

#1

What are the supported HTML tags in the Event Handler HTML MIME type? I’m trying to adjust the size of the QR code but haven’t found anything that works. I’ve tried the below:

<head>
     <style>
          .center \{ text-align: center; \}
     </style>
</head>
<body>
     <div class="center">
          <img src="{googleurl_image}" />
     </div>
</body>

In the above example, I get a failure to send notifications, it doesn’t appear to like CSS styling statements in the document head. On token creation, a red dialog box appears saying `u’ text-align’
'. The token is created but no notification is sent.

<body>
     <div>
          <img src="{googleurl_image}" style="text-align: center" />
     </div>
</body>

In this example, the notification is sent but the styling is not applied.

#2

Here you can see the supported tags: https://github.com/privacyidea/privacyidea/blob/master/privacyidea/lib/eventhandler/usernotification.py#L301
But I think this is not, what you asked for.

The curly braces are interpreted by the formatting command here.

You need to “escape” the curly braces by using double curly braces like this:

<head>
     <style>
          .center {{ text-align: center; }}
     </style>
</head>
<body>
     <div class="center">
          <img src="{googleurl_image}" />
     </div>
</body>

This should work™

#3

Escaping the curly braces worked, thank you sir!

1 Like
#4

Specifying CSS styling in the head seems to be hit or miss. Applying styling directly to the elements is the only sure-fire way I can get them to display properly. The Outlook client appears to ignoring sizing elements however…so that sucks. I can verify that Outlook Web Access properly renders them, but again, only when applying styling directly to the element.

#5

Obviously the problem is that outlook is no real mail client to does give a fuck about any standards.