Initial commit: Mail packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:51 +02:00
commit 4e53507711
1948 changed files with 751201 additions and 0 deletions

View file

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="mailing_contact_view_search" model="ir.ui.view">
<field name="name">mailing.contact.view.search.inherit.sms</field>
<field name="model">mailing.contact</field>
<field name="inherit_id" ref="mass_mailing.mailing_contact_view_search"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after">
<field name="mobile"/>
<field name="phone_sanitized" invisible="1"/>
</xpath>
<xpath expr="//filter[@name='filter_blacklisted']" position="attributes">
<attribute name="domain">['|', ('is_blacklisted','=',True), ('phone_sanitized_blacklisted','=',True)]</attribute>
</xpath>
<xpath expr="//filter[@name='filter_valid_email_recipient']" position="after">
<separator/>
<filter string="Valid SMS Recipients"
name="filter_valid_sms_recipient"
domain="[('opt_out', '=', False), ('phone_sanitized_blacklisted', '=', False), ('phone_sanitized', '!=', False)]"
invisible="not context.get('default_list_ids')"/>
</xpath>
<xpath expr="//filter[@name='filter_not_email_bl']" position="after">
<separator/>
<filter string="Exclude Blacklisted Phone"
name="filter_not_phone_bl"
domain="[('phone_sanitized_blacklisted', '=', False)]"/>
</xpath>
</field>
</record>
<record id="mailing_contact_view_tree" model="ir.ui.view">
<field name="name">mailing.contact.view.tree.inherit.sms</field>
<field name="model">mailing.contact</field>
<field name="inherit_id" ref="mass_mailing.mailing_contact_view_tree"/>
<field name="priority">20</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='country_id']" position="after">
<field name="mobile" class="o_force_ltr" readonly="1"/>
<field name="phone_sanitized" invisible="1"/>
<field name="phone_sanitized_blacklisted"/>
</xpath>
</field>
</record>
<record id="mailing_contact_view_form" model="ir.ui.view">
<field name="name">mailing.contact.view.form.inherit.sms</field>
<field name="model">mailing.contact</field>
<field name="inherit_id" ref="mass_mailing.mailing_contact_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='email_details']" position="after">
<label for="mobile" class="oe_inline"/>
<div class="o_row o_row_readonly" name="phone_details">
<button name="phone_action_blacklist_remove" class="fa fa-ban text-danger"
title="This phone number is blacklisted for SMS Marketing. Click to unblacklist."
type="object" context="{'default_phone': mobile}" groups="base.group_user"
attrs="{'invisible': [('mobile_blacklisted', '=', False)]}"/>
<field name="mobile" widget="phone" options="{'enable_sms': True}"/>
<field name="phone_sanitized" invisible="1"/>
<field name="mobile_blacklisted" invisible="1"/>
</div>
</xpath>
</field>
</record>
<record id="mailing_contact_view_kanban" model="ir.ui.view">
<field name="name">mailing.contact.view.kanban.inherit.sms</field>
<field name="model">mailing.contact</field>
<field name="inherit_id" ref="mass_mailing.mailing_contact_view_kanban"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='email']" position="after">
<field name="mobile" widget="phone"/>
<field name="phone_sanitized" invisible="1"/>
</xpath>
<xpath expr="//t[@t-esc='record.email.value']" position="after">
<t t-esc="record.mobile.value"/>
</xpath>
</field>
</record>
<record id="mailing_contact_action_sms" model="ir.actions.act_window">
<field name="name">Mailing List Contacts</field>
<field name="res_model">mailing.contact</field>
<field name="view_mode">tree,form</field>
<field name="context">{'mailing_sms': True, 'search_default_filter_not_phone_bl': 1, }</field>
<field name="view_id" ref="mailing_contact_view_tree"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a mailing contact
</p><p>
Mailing contacts allow you to separate your marketing audience from your contact directory.
</p>
</field>
</record>
</odoo>

View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="mailing_list_view_kanban" model="ir.ui.view">
<field name="name">mailing.list.view.kanban.inherit.mass.mailing.sms</field>
<field name="model">mailing.list</field>
<field name="inherit_id" ref="mass_mailing.mailing_list_view_kanban"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='contact_count_email']" position="after">
<field name="contact_count_sms"/>
</xpath>
<xpath expr="//div[hasclass('o_mass_mailing_kanban_contact_links')]" position="inside">
<a name="action_view_contacts_sms" type="object">
<span >Valid SMS Recipients</span>
<span t-esc="record.contact_count_sms.value" class="ms-3"/>
</a>
</xpath>
<xpath expr="//div[hasclass('o_mailing_list_kanban_stats')]//a" position="after">
<a class="me-sm-0 me-3 text-large" tabindex="-1"
name="action_view_contacts_sms" type="object">
<span class="fw-normal">
<field name="contact_count_sms"/>
</span>
<br/>
<span class="text-secondary">
<i class="fa fa-phone"/> Contacts
</span>
</a>
</xpath>
</field>
</record>
<record id="mailing_list_action_sms" model="ir.actions.act_window">
<field name="name">Mailing Lists</field>
<field name="res_model">mailing.list</field>
<field name="view_mode">kanban,tree,form</field>
<field name="context">{'mailing_sms': True}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a Mailing List
</p><p>
No need to import mailing lists, you can send SMS Text Messages to contacts saved in other Odoo apps.
</p>
</field>
</record>
</odoo>

View file

@ -0,0 +1,290 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo><data>
<record model="ir.ui.view" id="mailing_mailing_view_search_sms">
<field name="name">mailing.mailing.search</field>
<field name="model">mailing.mailing</field>
<field name="inherit_id" ref="mass_mailing.view_mail_mass_mailing_search"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//filter[@name='assigned_to_me']" position="attributes">
<attribute name="string">My SMS Marketing</attribute>
</xpath>
</field>
</record>
<record id="mailing_mailing_view_form_sms" model="ir.ui.view">
<field name="name">mailing.mailing.view.form.inherit.sms</field>
<field name="model">mailing.mailing</field>
<field name="inherit_id" ref="mass_mailing.view_mail_mass_mailing_form"/>
<field name="arch" type="xml">
<!-- Buttons / Actions -->
<xpath expr="//button[@name='action_launch']" position="attributes">
<attribute name="attrs">{'invisible': ['|', ('mailing_type', '!=', 'mail'), ('state', 'in', ('in_queue', 'sending', 'done'))]}</attribute>
</xpath>
<xpath expr="//button[@name='action_schedule']" position="before">
<field name="sms_force_send" invisible="1"/>
<field name="schedule_type" invisible="1"/>
<button name="action_put_in_queue" type="object"
string="Send" class="oe_highlight" data-hotkey="v"
attrs="{'invisible': ['|', '|', ('mailing_type', '=', 'mail'), ('state', 'in', ('in_queue', 'sending', 'done')), ('sms_force_send', '=', True)]}"
confirm="This will send SMS to all recipients. Do you still want to proceed ?"/>
<button name="action_send_mail" type="object"
string="Send Now" class="oe_highlight" data-hotkey="g"
attrs="{'invisible': ['|', '|', '|', ('mailing_type', '=', 'mail'), ('state', 'in', ('in_queue', 'done')), ('schedule_type', '=', 'scheduled'), ('sms_force_send', '!=', True)]}"
confirm="This will send SMS to all recipients now. Do you still want to proceed ?"/>
</xpath>
<!-- Headers / Warnings -->
<xpath expr="//header" position="after">
<field name="sms_has_insufficient_credit" invisible="1"/>
<div class="alert alert-warning text-center o-hidden-ios" attrs="{'invisible': [('sms_has_insufficient_credit', '=', False)]}" role="alert">
<button class="btn-link py-0"
name="action_buy_sms_credits"
type="object">
<strong>
It appears you don't have enough IAP credits. Click here to buy credits.
</strong>
</button>
</div>
<field name="sms_has_unregistered_account" invisible="1"/>
<div class="alert alert-warning text-center o-hidden-ios" attrs="{'invisible': [('sms_has_unregistered_account', '=', False)]}" role="alert">
<button class="btn-link py-0"
name="action_buy_sms_credits"
type="object">
<strong>
It appears your SMS account is not registered. Click here to set up your account.
</strong>
</button>
</div>
</xpath>
<xpath expr="//span[@name='canceled_text']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//span[@name='canceled_text']" position="after">
<span name="canceled_text_sms" attrs="{'invisible': [('mailing_type', '!=', 'sms')]}">SMS Text Message have been canceled and will not be sent.</span>
</xpath>
<xpath expr="//span[@name='scheduled_text']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//span[@name='scheduled_text']" position="after">
<span name="scheduled_text_sms" attrs="{'invisible': [('mailing_type', '!=', 'sms')]}">SMS Text Message are in queue and will be sent soon.</span>
</xpath>
<xpath expr="//span[@name='sent']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//span[@name='sent']" position="after">
<span name="sent_sms" attrs="{'invisible': [('mailing_type', '!=', 'sms')]}">SMS Text Message have been sent.</span>
</xpath>
<xpath expr="//span[@name='failed_text']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//span[@name='failed_text']" position="after">
<span name="failed_text_sms" attrs="{'invisible': [('mailing_type', '!=', 'sms')]}">SMS Text Message could not be sent.</span>
</xpath>
<xpath expr="//span[@name='next_departure_text']" position='attributes'>
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//span[@name='next_departure_text']" position='after'>
<span name="next_departure_text" attrs="{'invisible': [('mailing_type', '!=', 'sms')]}">This SMS marketing is scheduled for </span>
</xpath>
<!-- Stat Buttons -->
<xpath expr="//button[@name='action_view_opened']" position="attributes">
<attribute name="attrs">{'invisible': ['|',('mailing_type', '!=', 'mail'),('state', 'in', ('draft','test'))]}</attribute>
</xpath>
<xpath expr="//button[@name='action_view_replied']" position="attributes">
<attribute name="attrs">{'invisible': ['|',('mailing_type', '!=', 'mail'),('state', 'in', ('draft','test'))]}</attribute>
</xpath>
<!-- Form -->
<xpath expr="//label[@for='subject']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//label[@for='subject']" position="after">
<label for="sms_subject" attrs="{'invisible': [('mailing_type', '!=', 'sms')]}" />
</xpath>
<xpath expr="//field[@name='subject']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')], 'readonly': [('state', 'in', ('sending', 'done'))], 'required': [('mailing_type', '=', 'mail')]}</attribute>
<!-- overrided in xml view to prevent remaining helper changes (on mass_mailing module) when mass_mailing_sms uninstalled-->
<attribute name="help">For an Email, Subject your Recipients will see in their inbox.
For an SMS Text Message, internal Title of the Message.</attribute>
</xpath>
<xpath expr="//field[@name='subject']" position="after">
<field class="text-break" name="sms_subject" string="Title" placeholder="e.g. Black Friday SMS coupon" attrs="{'invisible': [('mailing_type', '!=', 'sms')], 'readonly': [('state', 'in', ('sending', 'done'))], 'required': [('mailing_type', '=', 'sms')]}"/>
</xpath>
<xpath expr="//button[@name='action_set_favorite']" position="attributes">
<attribute name="attrs">{'invisible': ['|', ('mailing_type', '!=', 'mail'), ('favorite', '=', True)]}</attribute>
</xpath>
<xpath expr="//button[@name='action_remove_favorite']" position="attributes">
<attribute name="attrs">{'invisible': ['|', ('mailing_type', '!=', 'mail'), ('favorite', '=', False)]}</attribute>
</xpath>
<xpath expr="//field[@name='preview']" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ('sending', 'done'))], 'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//page[@name='mail_body']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//page[@name='mail_body']" position="after">
<page string="SMS Content" name="sms_body" attrs="{'invisible': [('mailing_type', '!=', 'sms')]}">
<field name="body_plaintext" widget="sms_widget"
attrs="{'required': [('mailing_type', '=', 'sms')], 'readonly': [('state', 'in', ('sending', 'done'))]}"
options="{'dynamic_placeholder': true}" enable_emojis="true"/>
</page>
</xpath>
<xpath expr="//page[@name='settings']/group/group[@name='email_content']" position="after">
<group string="Options" attrs="{'invisible': [('mailing_type', '!=', 'sms')]}">
<field name="sms_allow_unsubscribe" attrs="{'invisible': [('mailing_type', '!=', 'sms')], 'readonly': [('state', 'in', ('sending', 'done'))]}"/>
</group>
</xpath>
<xpath expr="//field[@name='contact_list_ids']" position="attributes">
<attribute name="context">
{'mailing_sms' : context.get('mailing_sms'),
'form_view_ref': 'mass_mailing.mailing_list_view_form_simplified'}
</attribute>
</xpath>
<!-- Option page tweaks -->
<xpath expr="//field[@name='email_from']" position="attributes">
<attribute name="attrs">{
'invisible': [('mailing_type', '!=', 'mail')],
'readonly': [('state', 'in', ('sending', 'done'))]}
</attribute>
</xpath>
<xpath expr="//label[@for='reply_to']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//div[@name='reply_to_details']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//label[@for='attachment_ids']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//div[@name='attachment_ids_details']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//field[@name='mail_server_id']" position="attributes">
<attribute name="attrs">{'invisible': ['|', ('mailing_type', '!=', 'mail'),
('mail_server_available', '=', False)], 'readonly': [('state', 'in', ('sending', 'done'))]}</attribute>
</xpath>
<!-- A/B Testing -->
<xpath expr="//field[@name='ab_testing_winner_selection']" position="after">
<label for="ab_testing_sms_winner_selection" string="Winner Selection"
attrs="{'invisible': ['|', ('ab_testing_enabled', '=', False), ('mailing_type', '!=', 'sms')]}"/>
<field name="ab_testing_sms_winner_selection" nolabel="1"
attrs="{'required': [('ab_testing_enabled', '=', True), ('mailing_type', '=', 'sms')], 'invisible': ['|', ('ab_testing_enabled', '=', False), ('mailing_type', '!=', 'sms')], 'readonly': [('state', '!=', 'draft')]}"/>
</xpath>
<xpath expr="//field[@name='ab_testing_schedule_datetime']" position="replace">
<field name="ab_testing_schedule_datetime"
attrs="{'required': [('ab_testing_enabled', '=', True), ('ab_testing_winner_selection', '!=', 'manual'), ('ab_testing_sms_winner_selection', '!=', 'manual')], 'readonly': ['|', ('ab_testing_enabled', '=', False), ('state', '!=', 'draft')], 'invisible': ['|', '|', ('ab_testing_enabled', '=', False), ('ab_testing_winner_selection', '=', 'manual'), ('ab_testing_sms_winner_selection', '=', 'manual')]}"/>
</xpath>
<xpath expr="//span[@name='ab_test_manual']" position="attributes">
<attribute name="attrs">{'invisible': ['|', ('ab_testing_winner_selection', '!=', 'manual'),
('ab_testing_sms_winner_selection', '!=', 'manual')]}</attribute>
</xpath>
<xpath expr="//span[@name='ab_test_auto']" position="attributes">
<attribute name="attrs">{'invisible': [('ab_testing_winner_selection', '=', 'manual'),
('ab_testing_sms_winner_selection', '=', 'manual')]}</attribute>
</xpath>
<xpath expr="//button[@name='action_select_as_winner']" position="attributes">
<attribute name="attrs">{'invisible': ['|', ('ab_testing_completed', '!=', False), '|',
('ab_testing_winner_selection', '=', 'manual'),
('ab_testing_sms_winner_selection', '=', 'manual')]}</attribute>
</xpath>
</field>
</record>
<record id="mailing_mailing_view_form_mixed" model="ir.ui.view">
<!-- View allowign to display the mailing type and therefore choosing
the way of mailing: not prioritized one, used in some specific cases
like "contacting people" without predefining mail or sms -->
<field name="name">mailing.mailing.view.form.mixed</field>
<field name="model">mailing.mailing</field>
<field name="mode">primary</field>
<field name="priority">30</field>
<field name="inherit_id" ref="mass_mailing_sms.mailing_mailing_view_form_sms"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='mailing_type']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
</field>
</record>
<record id="mailing_mailing_view_kanban_sms" model="ir.ui.view">
<field name="name">mailing.mailing.view.kanban.inherit.sms</field>
<field name="model">mailing.mailing</field>
<field name="inherit_id" ref="mass_mailing.view_mail_mass_mailing_kanban"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='active']" position="after">
<field name="sms_has_insufficient_credit"/>
<field name="sms_has_unregistered_account"/>
</xpath>
<xpath expr="//div[@name='stat_opened']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//div[@name='stat_replied']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//div[@name='div_responsible_avatar']" position="after">
<div class="alert alert-warning mb-0 mt-3 o-hidden-ios" role="alert" attrs="{'invisible': [('sms_has_insufficient_credit', '=', False)]}">
<a name="action_buy_sms_credits" type="object">Insufficient credits</a>
</div>
<div class="alert alert-warning mb-0 mt-3" role="alert" attrs="{'invisible': [('sms_has_unregistered_account', '=', False)]}">
<a name="action_buy_sms_credits" type="object">Unregistered account</a>
</div>
</xpath>
</field>
</record>
<record id="mailing_mailing_view_tree_sms" model="ir.ui.view">
<field name="name">mailing.mailing.view.tree.sms</field>
<field name="model">mailing.mailing</field>
<field name="priority">20</field>
<field name="arch" type="xml">
<tree string="SMS Marketing" sample="1" decoration-info="state == 'draft'">
<field name="calendar_date" string="Date"/>
<field name="subject" string="Title"/>
<field name="mailing_type" invisible="1"/>
<field name="mailing_model_id" string="Recipients" optional="hide"/>
<field name="user_id" widget="many2one_avatar_user"/>
<field name="campaign_id" string="Campaign" groups="mass_mailing.group_mass_mailing_campaign" optional="hide"/>
<field name="ab_testing_enabled" string="A/B Test" groups="mass_mailing.group_mass_mailing_campaign"/>
<field name="sent" sum="Total Sent"/>
<field name="clicked" string="Clicked (%)" widget="progressbar" avg="Average of Clicked"/>
<field name="bounced" string="Bounced (%)" widget="progressbar" optional="hide" avg="Average of Bounced"/>
<field name="state" decoration-info="state in ('draft', 'in_queue')" decoration-success="state in ('sending', 'done')" widget="badge"/>
</tree>
</field>
</record>
<record id="mailing_mailing_action_sms" model="ir.actions.act_window">
<field name="name">SMS Marketing</field>
<field name="res_model">mailing.mailing</field>
<field name="view_mode">kanban,tree,form,calendar,graph</field>
<field name="search_view_id" ref="mailing_mailing_view_search_sms"/>
<field name="domain">[('mailing_type', '=', 'sms')]</field>
<field name="context">{
'search_default_assigned_to_me': 1,
'default_user_id': uid,
'default_mailing_type': 'sms',
'mailing_sms': True
}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a SMS Marketing Mailing
</p><p>
Write an appealing SMS Text Message, define recipients and track its results.
</p>
</field>
</record>
<record id="mailing_mailing_action_sms_view_kanban" model="ir.actions.act_window.view">
<field name="sequence">1</field>
<field name="view_mode">kanban</field>
<field name="view_id" ref="mailing_mailing_view_kanban_sms"/>
<field name="act_window_id" ref="mailing_mailing_action_sms"/>
</record>
<record id="mailing_mailing_action_sms_view_tree" model="ir.actions.act_window.view">
<field name="sequence">2</field>
<field name="view_mode">tree</field>
<field name="view_id" ref="mailing_mailing_view_tree_sms"/>
<field name="act_window_id" ref="mailing_mailing_action_sms"/>
</record>
</data></odoo>

View file

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- SMS Marketing -->
<menuitem id="mass_mailing_sms_menu_root"
name="SMS Marketing"
sequence="120"
web_icon="mass_mailing_sms,static/description/icon.svg"
groups="mass_mailing.group_mass_mailing_user"/>
<!-- SMS Marketing / SMS Marketing -->
<menuitem id="mass_mailing_sms_menu_mass_sms"
name="SMS Marketing"
action="mailing_mailing_action_sms"
parent="mass_mailing_sms_menu_root"
sequence="1"
groups="mass_mailing.group_mass_mailing_user"/>
<!-- SMS Marketing / Contacts Lists -->
<menuitem id="mass_mailing_sms_menu_contacts"
name="Mailing Lists"
parent="mass_mailing_sms_menu_root"
sequence="2"
groups="mass_mailing.group_mass_mailing_user"/>
<!-- SMS Marketing / Contacts Lists / Contacts Lists -->
<menuitem id="mailing_list_menu_sms"
name="Mailing Lists"
action="mailing_list_action_sms"
parent="mass_mailing_sms_menu_contacts"
sequence="1"
groups="mass_mailing.group_mass_mailing_user"/>
<!-- SMS Marketing / Contacts Lists / Contacts -->
<menuitem id="mailing_contact_menu_sms"
name="Mailing List Contacts"
action="mailing_contact_action_sms"
parent="mass_mailing_sms_menu_contacts"
sequence="2"
groups="mass_mailing.group_mass_mailing_user"/>
<!-- SMS Markrting / Campaigns -->
<menuitem id="menu_email_campaigns"
name="Campaigns"
parent="mass_mailing_sms_menu_root"
sequence="5"
action="mass_mailing.action_view_utm_campaigns"
groups="mass_mailing.group_mass_mailing_campaign"/>
<!-- SMS Marketing / Reporting -->
<menuitem id="mass_mailing_sms_menu_reporting"
name="Reporting"
action="mailing_trace_report_action_sms"
parent="mass_mailing_sms_menu_root"
sequence="80"
groups="mass_mailing.group_mass_mailing_user"/>
<!-- SMS Marketing / Configuration -->
<menuitem id="mass_mailing_sms_menu_configuration"
name="Configuration"
parent="mass_mailing_sms_menu_root"
sequence="100"
groups="mass_mailing.group_mass_mailing_user"/>
<!-- SMS Marketing / Configuration / Blacklist -->
<menuitem id="phone_blacklist_menu"
name="Blacklisted Phone Numbers"
parent="mass_mailing_sms_menu_configuration"
sequence="1"
action="phone_validation.phone_blacklist_action"
groups="mass_mailing.group_mass_mailing_user"/>
<!-- SMS Marketing / Configuration / Link Tracker -->
<menuitem id="link_tracker_menu"
name="Link Tracker"
parent="mass_mailing_sms_menu_configuration"
sequence="2"
action="link_tracker.link_tracker_action"
groups="mass_mailing.group_mass_mailing_user"/>
</odoo>

View file

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="mailing_trace_view_search" model="ir.ui.view">
<field name="name">mailing.trace.view.search.inherit.sms</field>
<field name="model">mailing.trace</field>
<field name="inherit_id" ref="mass_mailing.mailing_trace_view_search"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='email']" position="after">
<field name="sms_sms_id_int"/>
<field name="sms_sms_id"/>
<field name="sms_number"/>
</xpath>
</field>
</record>
<record id="mailing_trace_view_tree" model="ir.ui.view">
<field name="name">mailing.trace.view.tree.inherit.sms</field>
<field name="model">mailing.trace</field>
<field name="inherit_id" ref="mass_mailing.mailing_trace_view_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='email']" position="before">
<field name="trace_type"/>
</xpath>
<xpath expr="//field[@name='email']" position="after">
<field name="sms_number"/>
</xpath>
</field>
</record>
<record id="mailing_trace_view_tree_sms" model="ir.ui.view">
<field name="name">mailing.trace.view.tree.sms</field>
<field name="model">mailing.trace</field>
<field name="priority">20</field>
<field name="arch" type="xml">
<tree string="SMS Traces" create="0">
<field name="mass_mailing_id"/>
<field name="sms_number"/>
<field name="sent_datetime"/>
<field name="links_click_datetime"/>
<field name="trace_status" widget="badge"/>
<field name="failure_type" optional="show"/>
<field name="open_datetime" optional="hide"/>
<field name="reply_datetime" optional="hide"/>
<button name="action_view_contact" type="object"
string="Open Recipient" icon="fa-user"/>
</tree>
</field>
</record>
<record id="mailing_trace_view_form" model="ir.ui.view">
<field name="name">mailing.trace.view.form.inherit.sms</field>
<field name="model">mailing.trace</field>
<field name="inherit_id" ref="mass_mailing.mailing_trace_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='email']" position="attributes">
<attribute name="attrs">{'invisible': [('trace_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//field[@name='mail_mail_id_int']" position="attributes">
<attribute name="attrs">{'invisible': [('trace_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//field[@name='message_id']" position="attributes">
<attribute name="attrs">{'invisible': [('trace_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//field[@name='email']" position="after">
<field name="sms_number" attrs="{'invisible': [('trace_type', '!=', 'sms')]}"/>
</xpath>
<xpath expr="//field[@name='message_id']" position="after">
<field name="sms_sms_id_int" string="SMS ID"
attrs="{'invisible': [('trace_type', '!=', 'sms')]}"
groups="base.group_no_one"/>
<field name="sms_code" attrs="{'invisible': [('trace_type', '!=', 'sms')]}"
groups="base.group_no_one"/>
</xpath>
</field>
</record>
<record id="mailing_trace_view_form_sms" model="ir.ui.view">
<field name="name">mailing.trace.view.form.sms</field>
<field name="model">mailing.trace</field>
<field name="priority">20</field>
<field name="arch" type="xml">
<form string="SMS Trace" create="0" edit="0">
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_view_contact"
type="object" icon="fa-user" class="oe_stat_button">
<span widget="statinfo">Open Recipient</span>
</button>
</div>
<div class="alert alert-info text-center" attrs="{'invisible': [('trace_status', '!=', 'error')]}" role="alert">
<strong>This SMS could not be sent.</strong>
</div>
<div class="alert alert-info text-center" attrs="{'invisible': [('trace_status', '!=', 'bounce')]}" role="alert">
<strong>This number appears to be invalid.</strong>
</div>
<group>
<group string="Status">
<field name="trace_status"/>
<field name="failure_type" attrs="{'invisible' : [('failure_type', '=', False)]}"/>
<field name="sent_datetime" attrs="{'invisible' : [('sent_datetime', '=', False)]}"/>
<field name="links_click_datetime" attrs="{'invisible' : [('links_click_datetime', '=', False)]}"/>
<field name="open_datetime" attrs="{'invisible' : [('open_datetime', '=', False)]}"/>
<field name="reply_datetime" attrs="{'invisible' : [('reply_datetime', '=', False)]}"/>
</group>
<group string="Mailing">
<field name="trace_type" invisible="1"/>
<field name="sms_number"/>
<field name="mass_mailing_id"/>
<field name="sms_sms_id_int" string="SMS ID" groups="base.group_no_one"/>
<field name="sms_code" groups="base.group_no_one"/>
</group>
<group string="Marketing">
<field name="campaign_id" groups="mass_mailing.group_mass_mailing_campaign"/>
<field name="medium_id"/>
<field name="source_id"/>
<field name="sms_sms_id_int" groups="base.group_no_one"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
</odoo>

View file

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="blacklist_main" name="Unsubscribed">
<t t-call="portal.frontend_layout">
<div class="container mb64">
<div class="row">
<div class="col-lg-6 offset-lg-3">
<h3>SMS Subscription</h3>
<form t-att-action="'/sms/%s/unsubscribe/%s' % (mailing_id, trace_code)" method="post">
<p>Please enter your phone number</p>
<div class="mb-3 row">
<label for="sms_number" class="col-sm-2 col-form-label">Number</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="sms_number" id="sms_number" t-att-required="true"/>
</div>
</div>
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<input type="hidden" name="trace_code" t-att-value="trace_code"/>
<input type="hidden" name="mailing_id" t-att-value="mailing_id"/>
<div class="mb-3 row">
<div class="col-sm-10 offset-sm-2">
<button type="submit" class="btn btn-primary">Unsubscribe me</button>
</div>
</div>
</form>
</div>
</div>
</div>
</t>
</template>
<template id="blacklist_number" name="Unsubscribed">
<t t-call="portal.frontend_layout">
<div class="container mb64">
<div class="row">
<div class="col-lg-6 offset-lg-3">
<h3>SMS Subscription</h3>
<div t-if="unsubscribe_error" class="alert alert-danger text-center" role="alert">
<p>There was an error when trying to unsubscribe <strong t-esc="sms_number"/></p>
<p t-esc="unsubscribe_error"/>
</div>
<div t-else="" class="alert alert-success text-center" role="status">
<t t-if="lists_optout">
<p><strong t-esc="sms_number"/> has been successfully removed from</p>
<t t-foreach="lists_optout" t-as="list_id">
<strong t-esc="list_id.name"/><br />
</t>
</t>
<p t-else="">
<strong t-esc="sms_number"/> has been successfully blacklisted
</p>
</div>
</div>
</div>
</div>
</t>
</template>
</odoo>

View file

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model="ir.ui.view" id="utm_campaign_view_form">
<field name="name">utm.campaign.view.form</field>
<field name="model">utm.campaign</field>
<field name="inherit_id" ref="utm.utm_campaign_view_form"/>
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button name="action_create_mass_sms" type="object" class="oe_highlight" string="Send SMS"
attrs="{'invisible': [('is_mailing_campaign_activated', '=', False)]}"
groups="mass_mailing.group_mass_mailing_user"/>
</xpath>
<xpath expr="//div[hasclass('oe_button_box')]" position="inside">
<button name="action_redirect_to_mailing_sms"
type="object"
class="oe_stat_button order-11"
attrs="{'invisible': ['|', ('mailing_sms_count', '=', 0), ('is_mailing_campaign_activated', '=', False)]}"
icon="fa-mobile" groups="mass_mailing.group_mass_mailing_user">
<field name="mailing_sms_count" widget="statinfo" string="SMS"/>
</button>
</xpath>
<xpath expr="//sheet" position="inside">
<field name="ab_testing_mailings_sms_count" invisible="1"/>
</xpath>
<xpath expr="//notebook" position="inside">
<page string="SMS" name="sms"
attrs="{'invisible': ['|', ('mailing_sms_count', '=', 0), ('is_mailing_campaign_activated', '=', False)]}"
groups="mass_mailing.group_mass_mailing_user">
<group>
<field name="mailing_sms_ids" nolabel="1">
<tree>
<field name="calendar_date" string="Date"/>
<field name="subject" string="Title"/>
<field name="mailing_type" invisible="1"/>
<field name="mailing_model_id" string="Recipients" optional="hide"/>
<field name="user_id" widget="many2one_avatar_user"/>
<field name="campaign_id" string="Campaign" groups="mass_mailing.group_mass_mailing_campaign" optional="hide"/>
<field name="ab_testing_enabled" string="A/B Test"
groups="mass_mailing.group_mass_mailing_campaign"
attrs="{'column_invisible': [('parent.ab_testing_mailings_sms_count', '=', 0)]}"/>
<field name="sent" sum="Total Sent"/>
<field name="clicked" string="Clicked (%)" avg="Average of Clicked"/>
<field name="bounced" string="Bounced (%)" optional="hide" avg="Average of Bounced"/>
<field name="state" decoration-info="state in ('draft', 'in_queue')" decoration-success="state in ('sending', 'done')" widget="badge"/>
<button name="action_duplicate" type="object" string="Duplicate"/>
</tree>
</field>
</group>
</page>
</xpath>
<xpath expr="//group[@name='ab_test_group']" position="attributes">
<attribute name="attrs">{'invisible': [('ab_testing_mailings_sms_count', '=', 0), ('ab_testing_mailings_count', '=', 0)]}</attribute>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="utm_campaign_view_kanban">
<field name="name">utm.campaign.view.kanban</field>
<field name="model">utm.campaign</field>
<field name="inherit_id" ref="utm.utm_campaign_view_kanban"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='user_id']" position="after">
<field name="mailing_sms_count" groups="mass_mailing.group_mass_mailing_user"/>
</xpath>
<xpath expr="//ul[@id='o_utm_actions']">
<a name="action_redirect_to_mailing_sms" type="object"
t-attf-class="oe_mailings #{record.mailing_sms_count.raw_value === 0 ? 'text-muted' : ''}"
t-if="record.is_mailing_campaign_activated.raw_value"
groups="mass_mailing.group_mass_mailing_user">
<t t-out="record.mailing_sms_count.raw_value"/> SMS
</a>
</xpath>
</field>
</record>
</odoo>