<?xml version="1.0"?>
<kanban default_group_by="state" quick_create="false" sample="1">
                    <field name="state" readonly="1"/>
                    <field name="email_from" readonly="1"/>
                    <field name="color"/>
                    <field name="user_id"/>
                    <field name="expected"/>
                    <field name="failed"/>
                    <field name="total"/>
                    <field name="mailing_model_id"/>
                    <field name="mailing_model_name"/>
                    <field name="sent_date"/>
                    <field name="schedule_date"/>
                    <field name="next_departure"/>
                    <field name="active"/>
                    <templates>
                        <t t-name="kanban-box">
                            <div t-attf-class="{{!selection_mode ? 'oe_kanban_color_' + kanban_getcolor(record.color.raw_value) : ''}} oe_kanban_card oe_kanban_global_click oe_kanban_mass_mailing">
                                <div class="o_dropdown_kanban dropdown" t-if="!selection_mode">
                                    <a role="button" class="dropdown-toggle o-no-caret btn" data-bs-toggle="dropdown" href="#" data-bs-display="static" aria-label="Dropdown menu" title="Dropdown menu">
                                        <span class="fa fa-ellipsis-v"/>
                                    </a>
                                    <div class="dropdown-menu" role="menu">
                                        <ul class="oe_kanban_colorpicker" data-field="color"/>
                                        <t t-if="widget.deletable">
                                            <a role="menuitem" type="delete" class="dropdown-item">Delete</a>
                                        </t>
                                        <a role="menuitem" class="dropdown-item o_kanban_mailing_active" name="toggle_active" type="object">
                                            <t t-if="record.active.raw_value">Archive</t>
                                            <t t-if="!record.active.raw_value">Restore</t>
                                        </a>
                                    </div>
                                </div>
                                 <div class="oe_kanban_content">
                                    <div class="o_kanban_record_top">
                                        <div class="o_kanban_record_headings">
                                            <div class="row" attrs="{'invisible': [('sent_date', '=', False)]}">
                                                <h3 class="my-1 col-8 o_text_overflow">
                                                    <field name="subject"/>
                                                </h3>
                                                <div class="progress border col-3 px-0 mt-2" style="background-color: inherit; height:12px;">
                                                    <div class="progress-bar" role="progressbar" aria-valuemin="0" t-att-aria-valuenow="record.delivered.raw_value" t-att-aria-valuemax="record.expected.raw_value" t-attf-style="width: #{record.delivered.raw_value * 100 / record.expected.raw_value}%"/>
                                                </div>
                                            </div>
                                            <h3 class="my-1" attrs="{'invisible': [('sent_date', '!=', False)]}">
                                                <field name="subject"/>
                                            </h3>
                                            <field name="mailing_type" invisible="1"/>
                                            <div class="o_kanban_record_subtitle" attrs="{'invisible': [('sent_date', '=', False)]}">
                                                <h5 style="display: inline;">
                                                    <field name="campaign_id" groups="mass_mailing.group_mass_mailing_campaign"/>
                                                </h5>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="o_kanban_record_body" t-if="!selection_mode" attrs="{'invisible': [('sent_date', '=', False), ('schedule_date', '=', False), ('state', '!=', 'in_queue')]}">
                                        <div>
                                            <span attrs="{'invisible': [('sent_date', '=', False)]}" class="me-1"><b><field name="delivered"/> / <field name="expected"/></b> Delivered to</span>
                                            <span attrs="{'invisible': [('sent_date', '!=', False)]}" class="me-1"><b><field name="total"/></b></span>
                                            <field name="mailing_model_id" attrs="{'invisible': [('mailing_model_name','=','mailing.list')]}"/>
                                            <span attrs="{'invisible': [('mailing_model_name','!=','mailing.list')]}">Mailing Contact</span>
                                        </div>
                                        <div attrs="{'invisible': [('sent_date', '=', False)]}" class="d-flex justify-content-between">
                                            <div name="stat_opened">
                                                <b><field name="opened_ratio"/>%</b> Opened 
                                            </div>
                                            <div name="stat_replied">
                                                <b><field name="replied_ratio"/>%</b> Replied 
                                            </div>
                                            <div name="stat_clicks">
                                                <b><field name="clicks_ratio"/>%</b> Clicks 
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div name="div_responsible_avatar" class="o_kanban_record_bottom">
                                    <div class="oe_kanban_bottom_left">
                                        <span attrs="{'invisible': [('sent_date', '=', False)]}" t-attf-title="Sent on #{record.sent_date.value}" class="d-inline-flex">
                                            <span class="fa fa-calendar-check-o me-2 small my-auto" aria-label="Sent date"/>
                                            <span class="align-self-baseline"><field name="sent_date" widget="date"/></span>
                                        </span>
                                        <span attrs="{'invisible': [('schedule_date', '=', False)]}" t-attf-title="Scheduled on #{record.schedule_date.value}" class="d-inline-flex">
                                            <span class="fa fa-hourglass-half me-2 small my-auto" aria-label="Scheduled date"/>
                                            <span class="align-self-baseline"><field name="schedule_date" widget="date"/></span>
                                        </span>
                                        <span attrs="{'invisible': ['|', '|', ('sent_date', '!=', False), ('schedule_date', '!=', False), ('state', '=', 'in_queue')]}" class="clearfix">
                                            <b><field name="total" class="me-1"/></b>
                                            <field name="mailing_model_id" attrs="{'invisible': [('mailing_model_name','=','mailing.list')]}"/>
                                            <span attrs="{'invisible': [('mailing_model_name','!=','mailing.list')]}">Mailing Contact</span>
                                        </span>
                                        <span attrs="{'invisible': ['|', '|', ('schedule_date', '!=', False), ('state', '!=', 'in_queue'), ('next_departure', '=', False)]}" t-attf-title="Scheduled on #{record.next_departure.value}" class="d-inline-flex">
                                            <span class="fa fa-hourglass-o me-2 small my-auto" aria-label="Scheduled date"/>
                                            <span class="align-self-baseline">Next Batch</span>
                                        </span>
                                    </div>
                                    <div class="oe_kanban_bottom_right">
                                        <field name="user_id" widget="many2one_avatar_user"/>
                                    </div>
                                </div>
                            </div>
                        </t>
                    </templates>
                </kanban>
            