<table id="container" width="100%" style="color: #333; font-family: Helvetica,Arial,sans-serif; background-color: #f4f4f4; width: 100%; text-align: left; border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; border: 0" cellpadding="0" cellspacing="0" >
    <thead>
    <tr>
        <th>
            <table width="620px" color="#ffffff" cellspacing="0" cellpadding="10" style="margin: 0 auto">
                <tr>
                    <td width="400px">
                        <h1 style="color: #666; font-weight: normal; padding-top:20px;">{{ interval_type }}</h1>
                    </td>
                    <td width="200px" align="right">
                        <img src="{{ header_logo }}" alt="digest email" />
                    </td>
                </tr>
            </table>
        </th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td>
            <div style="padding: 10px 10px 1px; background-color: #ffffff; width: 600px; margin: 0 auto 20px">
                <small style="color: #999999">{{ lmsg('communication.digest.application_count', digests|length) }}</small>

                {% for digest in digests %}
                    <h2 style="margin: 10px 0 0">{{ digest.app_name }}</h2>

                    <small style="color: #999999; display: block; margin: 0 0 10px">{{ lmsg('communication.digest.notification_count', digest.messages|length) }}</small>

                    {% for message in digest.messages %}
                        <table width="100%" style="border: 1px solid #eeeeee; padding: 10px; margin: 0 0 10px">
                            <thead>
                            <tr>
                                <th align="left">{{ message.subject|raw }}</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td>{{ message.body|raw }}</td>
                            </tr>
                            </tbody>
                        </table>
                    {% endfor %}
                {% endfor %}
            </div>
        </td>
    </tr>
    </tbody>
    <tfoot>
    <tr>
        <td style="padding: 0 20px 20px">
            <table width="100%" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td color="#ccc" style="color: #999; font-size:11px;" align="center">
                        You were sent this email by {{ system_name }} because of your notification settings.
                        To change your notification settings, <a href="{{ settings_url }}" style="color: #ccc" color="#ccc">click here</a>.
                    </td>
                </tr>
                </tbody>
            </table>
        </td>
    </tr>
    </tfoot>
</table>
