Piwik Email Reports eating up mail account

Hi there,

Today, I have received our daily Piwik Email Reports. There’s a slight increase in email size every week. Every Email Report uses around 2MB per domain. How can I compress and reduce the mail size in Piwik?

Hi,

Are you using PDF or HTML reports?

If the former: Can you check if the size of the PDFs increase?

Excellent point. I am using HTML as Report Format. I’ve collected all reports from last 6 months. File size increases slightly. Looks like it’s caused by the attached png files.

Hi,

I have done some testing and the result is quite surprising:

At first, I suspected the small icons, as I have replaced them with higher resolution ones in the last piwik versions, but they seem to be linked. (And are just 2KB maximum), so they don’t count to the mail size.

Then I created a report with all possibilities ticked and graphs enabled.
The E-Mail saved as an .eml has 1,8MB, which is pretty similar to your size.
The graphs seem large, but when I exported all attachments in Thunderbird they were 21 Graphs with 1.3KB each (26KB total)
So I copied the HTML of the mail with KMail and pasted it in a text file. This file has 1.9MB (I think KMail prettifies the HTML) and has nothing base64 encoded in it, so all of it is HTML and inline styles.

I think the reason why the emails are that large, isn’t the images, but the HTML itself.
Just the CSS string font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Cantarell, 'Helvetica Neue', sans-serif; (120 characters) is found 2464 times in the HTML which results in about 295680 characters or about 0.3MB.
As E-Mails aren’t compressed the hundreds of inline styles and tr result in the large mail size.

<tr style="background-color: rgb(242,242,242);">

    <td style="padding:17px 15px;;border-bottom:1px solid rgb(231,231,231);font-size: 15px;padding:17px 15px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Cantarell, 'Helvetica Neue', sans-serif;">
        [some_text]
    </td>

    <td style="padding:17px 15px; text-align:right;;border-bottom:1px solid rgb(231,231,231);font-size: 15px;padding:17px 15px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Cantarell, 'Helvetica Neue', sans-serif;">
        1

    </td>

    <td style="padding:17px 15px; text-align:right;;border-bottom:1px solid rgb(231,231,231);font-size: 15px;padding:17px 15px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Cantarell, 'Helvetica Neue', sans-serif;">
        0

    </td>

    <td style="padding:17px 15px; text-align:right;;border-bottom:1px solid rgb(231,231,231);font-size: 15px;padding:17px 15px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Cantarell, 'Helvetica Neue', sans-serif;">
        1

    </td>

    <td style="padding:17px 15px; text-align:right;;border-bottom:1px solid rgb(231,231,231);font-size: 15px;padding:17px 15px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Cantarell, 'Helvetica Neue', sans-serif;">
        100%

    </td>

    <td style="padding:17px 15px; text-align:right;;border-bottom:1px solid rgb(231,231,231);font-size: 15px;padding:17px 15px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Cantarell, 'Helvetica Neue', sans-serif;">
        0%

    </td>

</tr>

Unfortunately I can’t think of a way to improve this as CSS support in E-Mails is horrible and only inline styles work the way they should.

1 Like

Lukas, thank you for taking a closer look. Indeed all checkboxes have been enabled. Unchecking a couple of report settings makes a great difference in terms of message size. I think it’s a good compromis, though.

Yeah, that’s the way how HTML email works.

1 Like