<?xml version="1.0"?>
<odoo>
        <record id="shift_subscription" model="mail.template">
            <field name="name">Shift subscription</field>
            <field name="model_id" ref="coop_shift.model_shift_registration"/>
            <field name="email_from">${(object.shift_id.organizer_id.email or object.shift_id.user_ids[0].email or '')|safe}</field>
            <field name="email_to" >${object.email|safe}</field>
            <field name="lang">${object.partner_id.lang}</field>
            <field name="reply_to">${object.shift_id.reply_to or (object.shift_id.shift_type_id and object.shift_id.shift_type_id.default_reply_to) or ''|safe}</field>
            <field name="subject">Your subscription at ${object.shift_id.name}</field>
            <field name="body_html"><![CDATA[<p>Hello ${object.name},</p>
<p>
    We remind you that your next shift is scheduled for <bold>${object.shift_id.begin_date_without_time_string}</bold> and will begin at ${object.shift_id.begin_time_string}
</p>
<p>For more information, please contact the Member Bureau or your shift leader.</p>
<p>
    If you have any questions or need information, please contact the Member's Office during its opening hours.
</p>
<p>
    Opening hours of the Members Bureau:
    <br/>- Tuesday: 13h30 - 16h
    <br/>- Wednesday to Friday: 13h30 - 20h
    <br/>- Saturday: 10h - 16h
</p>
<p>Phone number: 01 86 95 91 90</p>
<p>Thank you for your participation!</p>
<p>Best regards</p>]]></field>
        </record>

        <record id="shift_reminder" model="mail.template">
            <field name="name">Shift: reminder</field>
            <field name="model_id" ref="coop_shift.model_shift_registration"/>
            <field name="email_from">${(object.shift_id.organizer_id.email or object.shift_id.user_ids[0].email or '')|safe}</field>
            <field name="email_to" >${object.partner_id.email or object.email|safe}</field>
            <field name="lang">${object.partner_id.lang}</field>
            <field name="reply_to">${object.shift_id.reply_to or (object.shift_id.shift_type_id and object.shift_id.shift_type_id.default_reply_to) or ''|safe}</field>
            <field name="subject">Reminder of shift ${object.shift_id.name}</field>
            <field name="body_html"><![CDATA[<p>Hello ${object.name},</p>
<p>This is a reminder for ${object.shift_id.name} that you registered for is confirmed and will be held from ${object.shift_id.date_begin_located} to ${object.shift_id.date_end_located}.
For any further information please contact our shift department.</p>
<p>You can get your next shift on our website : https://membres.cooplalouve.fr/</p>
<p>Thank you for your participation!</p>
<p>Best regards</p>]]></field>
        </record>

        <record id="shift_thanks" model="mail.template">
            <field name="name">Shift: thanks for attending</field>
            <field name="model_id" ref="coop_shift.model_shift_registration"/>
            <field name="email_from">${(object.shift_id.organizer_id.email or object.shift_id.user_ids[0].email or '')|safe}</field>
            <field name="email_to" >${object.partner_id.email or object.email|safe}</field>
            <field name="lang">${object.partner_id.lang}</field>
            <field name="reply_to">${object.shift_id.reply_to|safe}</field>
            <field name="subject">Thanks for attending ${object.shift_id.name}</field>
            <field name="body_html"><![CDATA[<p>Hello ${object.name},</p>
<p>We would like to thank you for your presence at our shift ${object.shift_id.name}.
<br/><br/>
    % if object.shift_id.organizer_id and object.shift_id.organizer_id.is_company:
        <strong>The ${object.shift_id.organizer_id.name} Team</strong>
    % elif object.shift_id.organizer_id:
        <strong>${object.shift_id.organizer_id.name}</strong>
    % endif
</p>]]></field>
        </record>

</odoo>