Skip to content

Commit

Permalink
[IMP] mass mailing: improve demo data
Browse files Browse the repository at this point in the history
Purpose of this commit is to have some demo data that are coherent. Main things
done in this commit are

 * clean the body of the first mass mailing given to the user in order to have
   a content more inlined with odoo emails;
 * update filter of the demo mass mailing to limit the results to something
   predictable, aka contacts of ReadyMat;
 * update statistics to be really linked to customer of the demo company by
   setting model and res_id;
 * create a statistics for each child of the company ReadyMat so that stat
   buttons redirect correctly to a filetered view;

This commit is linked to task ID 1885121 and closes PR #27003.
  • Loading branch information
tde-banana-odoo committed Sep 20, 2018
1 parent 1f6d534 commit e7c53bd
Showing 1 changed file with 94 additions and 15 deletions.
109 changes: 94 additions & 15 deletions addons/mass_mailing/data/mass_mailing_demo.xml
Expand Up @@ -52,49 +52,128 @@
<field name="name">First Newsletter</field>
<field name="state">done</field>
<field name="user_id" eval="ref('base.user_admin')"/>
<field name="email_from">info@yourcompany.example.com</field>
<field name="sent_date" eval="(DateTime.today() - relativedelta(days=5)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="mass_mailing_campaign_id" eval="ref('mass_mail_campaign_1')"/>
<field name="campaign_id" ref="utm.utm_campaign_email_campaign_products"/>
<field name="source_id" ref="mass_mailing.utm_source_0"/>
<field name="medium_id" ref="utm.utm_medium_email"/>
<field name="mailing_model_id" ref="base.model_res_partner"/>
<field name="mailing_domain">[('customer', '=', True)]</field>
<field name="mailing_domain" eval="[('parent_id', '=', ref('base.res_partner_4'))]"/>
<field name="reply_to_mode">email</field>
<field name="reply_to"><![CDATA[Info <info@yourcompany.example.com>]]></field>
<field name="body_html"><![CDATA[<div class="snippet_row bg-color" style="padding:0px;width:600px;margin:auto;background: #ffffff repeat top /100%">
<table cellpadding="0" cellspacing="0" style="border-collapse:collapse" width="100%"><tbody><tr><td style="padding:10px 10px 10px 5px" valign="center" width="270"> <a style="text-decoration:none" href="http://www.example.com"><strong>My Company</strong></a> </td><td style="padding:10px 15px 10px 10px;vertical-align:middle" valign="center" width="270"><table align="right" border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse"><tbody><tr><td align="right"><a target="_blank" href="https://www.facebook.com/Odoo"><span class="fa fa-facebook-square fa-2x" style="color:#44B7B7;" role="img" aria-label="Facebook" title="Facebook"></span></a></td><td align="right" style="padding-left:5px"><a target="_blank" href="https://www.facebook.com/Odoo"><span class="fa fa-google-plus-square fa-2x" style="color:#44B7B7;" role="img" aria-label="Google Plus" title="Google Plus"></span></a></td><td align="right" style="padding-left:5px"><a target="_blank" href="https://www.facebook.com/Odoo"><span class="fa fa-linkedin-square fa-2x" style="color:#44B7B7;" role="img" aria-label="LinkedIn" title="LinkedIn"></span></a></td><td align="right" style="padding-left:5px"><a target="_blank" href="https://www.facebook.com/Odoo"><span class="fa fa-twitter-square fa-2x" style="color:#44B7B7;" role="img" aria-label="Twitter" title="Twitter"></span></a></td></tr></tbody></table></td></tr></tbody></table></div><div style="padding:0px;width:600px;margin:auto;background-color:#44B7B7;color:#168484"><table cellpadding="0" cellspacing="0" style="width:100%;background-color:inherit;border-collapse:collapse;color:inherit"><tbody><tr><td class="col_mv bg-color" style="text-align:left; padding-left:20px;vertical-align:middle;font-size:14px"><p style="margin:0;font-size:20px;color:#fff">You get a 20% discount for signing up!</p><p style="margin:0">Discount Code: <strong>45A9E77DGW8455</strong></p></td><td class="col_mv bg-color" style="padding:20px;text-align:center;vertical-align:middle"> <span class="fa fa-6x fa-ticket" role="img" aria-label="Ticket" title="Ticket"></span> </td></tr></tbody></table></div><div class="snippet_row bg-color" style="padding:0;width:600px;max-width:600px;margin:0 auto;background: #fff repeat top /100%;color:#168484"><table style="width:100%;text-align:justify;margin:0 auto;inherit;border-collapse:collapse;color:inherit"><tbody><tr><td style="padding:10px 30px;font-size:14px;line-height:20px"><p style="margin:0">Dear ${object.name}</p><p style="margin:0">Great stories have personality. Consider telling a great story that provides personality. Writing a story with personality for potential clients will assist with making a relationship connection. This shows up in small quirks like word choices or phrases. Write from your point of view, not from someone else's experience.<br></p><p style="margin:0">Great stories are for everyone even when only written for just one person. If you try to write with a wide general audience in mind, your story will ring false and be bland. No one will be interested. Write for one person. If it’s genuine for the one, it’s genuine for the rest.</p><p style="margin:0">Kind Regards,</p><p style="margin:0">Michael Fletcher</p></td></tr></tbody></table></div><div style="padding:0;width:600px;max-width:600px;margin:0 auto"><table style="width:100%;text-align:justify;margin:0 auto;background-color:inherit;border-collapse:collapse"><tbody><tr><td class="col_mv bg-color" style="padding:10px 0;background-color:#168484;color:#fff"><table style="border-collapse:collapse;background-color:inherit"><tbody><tr><td rowspan="2" style="padding-left:10px"> <span class="fa fa-check fa-3x" role="img" aria-label="Check" title="Check"></span> </td><td style="padding-left:10px;color:#fff;font-size:14px"><p style="font-weight:bold;font-size:18px;margin:0 0 3px 0">Step 1:</p><p style="margin:0">Place Order</p></td></tr></tbody></table></td><td class="col_mv bg-color" style="padding:10px 0;background-color:#FFFFFF;color:#808080"><table style="border-collapse:collapse;background-color:inherit"><tbody><tr><td rowspan="2" style="padding-left:10px"> <span class="fa fa-truck fa-3x" role="img" aria-label="Truck" title="Truck"></span> </td><td style="padding-left:10px;color:#808080;font-size:14px"><p style="font-weight:bold;font-size:18px;margin:0 0 3px 0">Step 2:</p><p style="margin:0">Shipping</p></td></tr></tbody></table></td><td class="col_mv bg-color" style="padding:10px 0;background-color:#FFFFFF;color:#808080"><table style="border-collapse:collapse;background-color:inherit"><tbody><tr><td rowspan="2" style="padding-left:10px"> <span class="fa fa-dollar fa-3x" role="img" aria-label="Money" title="Money"></span> </td><td style="padding-left:10px;color:#808080;font-size:14px"><p style="font-weight:bold;font-size:18px;margin:0 0 3px 0">Step 3:</p><p style="margin:0">Payment</p></td></tr></tbody></table></td></tr></tbody></table></div><div class="snippet_row bg-color" style="padding:0px;width:600px;margin:auto;background: #414141 repeat top /100%;color:#44B7B7"><div style="padding:10px"><table cellpadding="0" cellspacing="0" style="margin: 0 auto;width:100%;border-collapse:collapse;color:inherit;color:inherit"><tbody><tr><td style="text-align:center"> <a target="_blank" style="text-decoration: none;" href="https://www.facebook.com/Odoo"><span class="fa fa-facebook-square fa-2x" role="img" aria-label="Facebook" title="Facebook"></span></a><a target="_blank" style="text-decoration: none;" href="https://plus.google.com/+Odooapps"><span class="fa fa-google-plus-square fa-2x" role="img" aria-label="Google Plus" title="Google Plus"></span></a><a target="_blank" style="text-decoration: none;" href="https://www.linkedin.com/company/odoo"><span class="fa fa-linkedin-square fa-2x" role="img" aria-label="LinkedIn" title="LinkedIn"></span></a><a target="_blank" style="text-decoration: none;" href="https://twitter.com/Odoo"><span class="fa fa-twitter-square fa-2x" role="img" aria-label="Twitter" title="Twitter"></span></a> </td></tr><tr><td style="font-size:12px;text-align:center;padding-top:10px;padding-bottom:5px"> <a href="/unsubscribe_from_list" style="color:#44B7B7">Unsubscribe</a>|<a href="/page/contactus" style="color:#44B7B7">Contact</a> </td></tr></tbody></table></div>
</div>]]></field>
<field name="reply_to">Info &lt;info@yourcompany.example.com&gt;</field>
<field name="body_html" type="html">
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 24px; background-color: white; color: #454748; border-collapse:separate;">
<tbody>
<!-- HEADER -->
<tr>
<td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: white; padding: 0; border-collapse:separate;">
<tr><td valign="middle">
<span style="font-size: 20px; font-weight: bold;">Your Company</span>
</td><td valign="middle" align="right">
<img src="/logo.png" style="padding: 0px; margin: 0px; height: 48px;" alt="YourCompanyny"/>
</td></tr>
<tr><td colspan="2" style="text-align:center;">
<hr width="100%" style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin:4px 0px 32px 0px;"/>
</td></tr>
</table>
</td>
</tr>
<!-- CONTENT -->
<tr>
<td style="min-width: 590px;">
<div style="margin: 0px; padding: 0px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
Great stories have personality. Consider telling a great story that provides personality.
Writing a story with personality for potential clients will assist with making a relationship connection.
This shows up in small quirks like word choices or phrases. Write from your point of view, not from someone else's experience.<br />
Great stories are for everyone even when only written for just one person.
If you try to write with a wide general audience in mind, your story will ring false and be bland.
No one will be interested. Write for one person. If it’s genuine for the one, it’s genuine for the rest.
</p>
</div>
</td>
</tr>
<!-- FOOTER -->
<tr>
<td align="center" style="min-width: 590px; padding: 0 8px 0 8px; font-size:11px;">
<hr width="100%" style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 4px 0px;"/>
<b>YourCompany</b><br/>
<div style="color: #999999;">
<a href="/unsubscribe_from_list" style="text-decoration:none; color: #999999;">Unsubscribe</a>
|
<a href="/page/contactus" style="text-decoration:none; color: #999999;">Contact</a>
</div>
</td>
</tr>
</tbody>
</table>
</td></tr>
<!-- POWERED BY -->
<tr><td align="center" style="min-width: 590px;">
Powered by <a target="_blank" href="https://www.odoo.com?utm_source=db&amp;utm_medium=email" style="color: #875A7B;">Odoo</a>
</td></tr>
</table>
</field>
<field name="attachment_ids" eval="[(4, ref('mass_mail_attach_1'))]"/>
</record>

<record id="mass_mail_email_1" model="mail.mail.statistics">
<record id="mass_mail_1_stat_0" model="mail.mail.statistics">
<field name="mass_mailing_id" eval="ref('mass_mail_1')"/>
<field name="message_id">1111000@OpenERP.com</field>
<field name="message_id">1111000@odoo.com</field>
<field name="model">res.partner</field>
<field name="res_id" ref="base.res_partner_address_7"/>
<field name="sent" eval="(DateTime.today() - relativedelta(days=5)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="opened" eval="(DateTime.today() - relativedelta(days=2)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="replied" eval="(DateTime.today() - relativedelta(days=1)).strftime('%Y-%m-%d %H:%M:%S')"/>
</record>
<record id="mass_mail_email_2" model="mail.mail.statistics">
<record id="mass_mail_1_stat_1" model="mail.mail.statistics">
<field name="mass_mailing_id" eval="ref('mass_mail_1')"/>
<field name="message_id">1111001@OpenERP.com</field>
<field name="message_id">1111001@odoo.com</field>
<field name="model">res.partner</field>
<field name="res_id" ref="base.res_partner_address_13"/>
<field name="sent" eval="(DateTime.today() - relativedelta(days=5)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="opened" eval="(DateTime.today() - relativedelta(days=2)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="replied" eval="(DateTime.today() - relativedelta(days=0)).strftime('%Y-%m-%d %H:%M:%S')"/>
</record>
<record id="mass_mail_email_3" model="mail.mail.statistics">
<record id="mass_mail_1_stat_2" model="mail.mail.statistics">
<field name="mass_mailing_id" eval="ref('mass_mail_1')"/>
<field name="message_id">1111002@OpenERP.com</field>
<field name="message_id">1111002@odoo.com</field>
<field name="model">res.partner</field>
<field name="res_id" ref="base.res_partner_address_14"/>
<field name="sent" eval="(DateTime.today() - relativedelta(days=5)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="opened" eval="(DateTime.today() - relativedelta(days=2)).strftime('%Y-%m-%d %H:%M:%S')"/>
</record>
<record id="mass_mail_1_stat_3" model="mail.mail.statistics">
<field name="mass_mailing_id" eval="ref('mass_mail_1')"/>
<field name="message_id">1111003@odoo.com</field>
<field name="model">res.partner</field>
<field name="res_id" ref="base.res_partner_address_24"/>
<field name="opened" eval="(DateTime.today() - relativedelta(days=1)).strftime('%Y-%m-%d %H:%M:%S')"/>
</record>
<record id="mass_mail_1_stat_4" model="mail.mail.statistics">
<field name="mass_mailing_id" eval="ref('mass_mail_1')"/>
<field name="message_id">1111004@odoo.com</field>
<field name="model">res.partner</field>
<field name="res_id" ref="base.res_partner_address_32"/>
<field name="sent" eval="(DateTime.today() - relativedelta(days=5)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="opened" eval="(DateTime.today() - relativedelta(days=1)).strftime('%Y-%m-%d %H:%M:%S')"/>
</record>
<record id="mass_mail_email_4" model="mail.mail.statistics">
<record id="mass_mail_1_stat_5" model="mail.mail.statistics">
<field name="mass_mailing_id" eval="ref('mass_mail_1')"/>
<field name="message_id">1111003@OpenERP.com</field>
<field name="message_id">1111004@odoo.com</field>
<field name="model">res.partner</field>
<field name="res_id" ref="base.res_partner_address_33"/>
<field name="sent" eval="(DateTime.today() - relativedelta(days=5)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="exception" eval="(DateTime.today() - relativedelta(days=5)).strftime('%Y-%m-%d %H:%M:%S')"/>
</record>
<record id="mass_mail_email_5" model="mail.mail.statistics">
<record id="mass_mail_1_stat_6" model="mail.mail.statistics">
<field name="mass_mailing_id" eval="ref('mass_mail_1')"/>
<field name="message_id">1111004@OpenERP.com</field>
<field name="message_id">1111004@odoo.com</field>
<field name="model">res.partner</field>
<field name="res_id" ref="base.res_partner_address_34"/>
<field name="sent" eval="(DateTime.today() - relativedelta(days=5)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="bounced" eval="(DateTime.today() - relativedelta(days=3)).strftime('%Y-%m-%d %H:%M:%S')"/>
</record>
Expand Down

0 comments on commit e7c53bd

Please sign in to comment.