heml icon indicating copy to clipboard operation
heml copied to clipboard

wrong formatting on clients

Open ktsaou opened this issue 7 years ago • 9 comments

Hi,

Thank you for heml ! Email html is problematic and your work will certainly help a lot of people !

I am trying to use heml for formatting https://my-netdata.io (https://github.com/firehol/netdata) HTML emails.

I found a few formatting discrepancies among email clients, so I thought I should let you know.

The key problem is MS Office Outlook (check below). All the others are just imperfections.

Keep in mind I just found heml today, so please be gentle if I did it the wrong way.

Click to see my heml file
<heml>
  <head>
    <subject>badhost needs attention - inbound packets dropped ratio - net_packets.eth0</subject>
    <style>
      body { background: White; }
      h1 { color: Black; }
    </style>
  </head>
  <body>
    <container style="background: #eeeeee; padding: 0.5em;">
      <container style="background: White; color: Black; padding: 0;">
        <container style="background: #dddddd; color: Black; padding-left: 0.5em;  padding-right: 0.5em; width: calc(100% - 1em);">
          <p align="right">netdata alarm notification</p>
        </container>
        <container style="background: Orange; color: White; padding-left: 0.5em;  padding-right: 0.5em;  width: calc(100% - 1em);">
          <h2 align="center">
          badhost needs attention
          </h2>
        </container>
        <container style="background: White; color: Black; padding: 0.5em;   width: calc(100% - 1em);">
          <container style="padding: 0;">
            <h3>
              inbound packets dropped ratio = 0.14%
            </h3>
            <p>
              the ratio of inbound dropped packets vs the total number of received packets of the network interface, during the last 10 minutes
            </p>
            <container>
              <row>&nbsp;</row>
              <row>
                <column large="6" small="6">net_packets.eth0</column>
                <column>eth0</column>
                <column>WARNING</column>
              </row>
              <row  style="color: grey; font-size: 0.7em;">
                <column large="6" small="6">chart</column>
                <column>family</column>
                <column>severity</column>
              </row>
              <row>&nbsp;</row>
              <row>
                <column large="12" small="12">Sun Oct 29 12:19:16 EET 2017</column>
              </row>
              <row  style="color: grey; font-size: 0.7em;">
                <column large="12" small="12">date</column>
              </row>
            </container>
            <container>
              <button href="https://registry.my-netdata.io/goto-host-from-alarm.html?host=badhost&chart=net_packets.eth0&family=eth0&alarm=inbound_packets_dropped_ratio&alarm_unique_id=1499830026&alarm_id=1499800300&alarm_event_id=2047">view netdata dashboard</button>
            </container>
            <container style="font-size: 0.83em; color: grey;">
            &nbsp;
            </container>
            <hr style="color: lightgrey;" />
              <p align="center"  style="font-size: 0.7em; line-height: 1.3em; color: grey;">
              The source of this alarm is line <code>37@/etc/netdata/health.d/net.conf</code>
              <br/>
              (alarms are configurable, edit this file to adapt the alarm to your needs)
              <br/>&nbsp;<br/>
              Sent by netdata, the real-time performance and health monitoring,
              <br/>
              running on <code>box</code>.
              </p>
          </container>
        </container>
      </container>
    </container>
    <container>
      <marquee>badhost has 4 critical and 2 warning alarms 💌</marquee>
    </container>
  </body>
</heml>

heml editor

This is what the heml editor shows:

image

gmail

Perfect. Marquee does not roll, but it shows up nicely.

screenshot from 2017-10-29 14-23-09

outlook (MS Office Professional Plus 2016)

The main problems are:

  1. sizing of containers is inaccurate (note the white space on the sides of the orange container)
  2. tables, buttons and marquee fonts have been reset to Times and black.
  3. line-height seems to be ignored.

image

office 365 web access

Perfect! Even the marquee rolls!

screenshot from 2017-10-29 14-43-59

evolution 3.24.6

Almost perfect. It seems to ignore font sizes in style.

image

thunderbird 52.4.0

Almost perfect. It seems to ignore font sizes and colors at the tables.

image

Apple iOS 11.0.3 mail

Seems perfect! Even marquee rolls.

Outlook for iOS

Almost perfect! If seems to ignore completely the empty lines at the table (i.e. <row>&nbsp;</row>).

img_4461

ktsaou avatar Oct 29 '17 12:10 ktsaou

btw, to send the emails, I used the HTML generated by the code tab of the editor (just in case the editor is not up to date with the repo).

ktsaou avatar Oct 29 '17 13:10 ktsaou

This is amazing feedback, thank you! HEML is still in its early days so there are definitely kinks to be worked out.

I'll dig into this on Monday 👍

At the moment the editor is at the same point as the repo. Definitely gonna try to keep that up.

avigoldman avatar Oct 29 '17 16:10 avigoldman

This is a wonderful project! However, I get similar formatting discrepancies, specifically with Windows 10 Mail. This is what I see in the online editor preview: image

And this is what I get in Mail: image

I pasted the code from the "Code" tab in the editor straight into Mandrill; I'll try again running that through Mandrill's own inliner and see what happens...

cicely-f avatar Nov 07 '17 12:11 cicely-f

I can confirm that running it through Mandrill's inliner changes nothing at all, which is good, of course. Saves one more step. :)

cicely-f avatar Nov 07 '17 12:11 cicely-f

Thanks for double checking with that. You shouldn't need to run any external inliner, so that's good it didn't help, I guess 😉 Can you share the HEML you used to generate that email?

avigoldman avatar Nov 07 '17 16:11 avigoldman

Unfortunately not, I made so many changes since then, and now I've rebuilt the template in MailChimp's own editor, which allows export to Mandrill, and, while not perfect, it's a lot more like it should be...

cicely-f avatar Nov 08 '17 08:11 cicely-f

No worries! I'll see if I can find where that rendering issue is stemming from. Thanks for pointing it out!

avigoldman avatar Nov 08 '17 14:11 avigoldman

Issue

brunah avatar Nov 09 '17 15:11 brunah

Issue

brunah avatar Nov 09 '17 15:11 brunah