<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <template id="digest_layout" name="Mail digest layout">
        <html>
            <body>
                <img style="float: right" t-attf-src="data:image;base64,{{env.user.company_id.logo}}" />
                <!-- if some template calling us sets this variable,
                     we print a h1 tag /-->
                <h1 t-if="email_heading"><t t-raw="email_heading" /></h1>
                <t t-raw="0" />
                <!-- use some standard footer if the user doesn't have
                     a signature /-->
                <footer t-if="not email_use_user_signature">
                    <p>
                        <a t-att-href="env.user.company_id.website">
                            <t t-esc="env.user.company_id.name" />
                        </a>
                    </p>
                    <p><t t-esc="env.user.company_id.phone" /></p>
                </footer>
                <footer t-if="email_use_user_signature">
                    <t t-raw="env.user.signature" />
                </footer>
            </body>
        </html>
    </template>

    <template id="default_digest_tmpl" name="Mail digest default template">
        <t t-call="mail_digest.digest_layout">
            <div id="mail_content">
                <h2>Hello,</h2>
                <div id="mail_inner_content">
                    <t t-foreach="grouped_messages.iterkeys()" t-as="gkey">
                        <t t-set="messages" t-value="grouped_messages[gkey]" />
                        <t t-foreach="messages" t-as="msg">
                            <div style="margin:20px">
                                <h3 t-esc="msg.subject" />
                                <t t-raw="msg.body" />
                            </div>
                        </t>
                    </t>
                </div>
            </div>
        </t>
    </template>

</odoo>
