Files
odoo_source/addons/website_slides/data/mail_template_data.xml
T
Thibault Delavallée f2dd80677c [MOV][IMP] website_{profile/slides}: reorganize qweb / jinja templates used for mailing
PURPOSE

Clean organization of templates in odoo apps: mail.template records in data,
qweb templates (views) used directly in code, notably using post with view.
Purpose is to ease future improvements in posting based on templates.

SPECIFICATIONS

  * move those templates in their own file to ease their discovering and
    maintenance;
  * put them into data (as those are not views even if it contains qweb)
  * guidelines are now :

    -> Qweb templates should be in data/mail_templates.xml;
    -> mail.template records should be in data/mail_template_data.xml;

  * put their declaration in no update when not done if template has no
    technical code or complex dependency on underlying code;
  * move found mail data (mail.message.subtype or mail.activity.type) records
    in a mail_data file that should contain only "core" records linked to mail;

LINKS

Task ID-2375767
COM PR odoo/odoo#61814
ENT PR odoo/enterprise#14775
UPG PR odoo/upgrade#1936
2020-11-25 12:31:09 +00:00

117 lines
6.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="slide_template_published" model="mail.template">
<field name="name">Slide Published</field>
<field name="model_id" ref="model_slide_slide"/>
<field name="subject">New ${object.slide_type} published on ${object.channel_id.name}</field>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
Hello<br/><br/>
There is something new in the course <strong>${object.channel_id.name}</strong> you are following:<br/><br/>
<center><strong>${object.name}</strong></center>
% if object.image_1024
<div style="margin: 16px 8px 16px 8px; text-align: center;">
<a href="${object.website_url}">
<img alt="${object.name}" src="${ctx['base_url']}/web/image/slide.slide/${object.id}/image_1024" style="height:auto; width:150px; margin: 16px;"/>
</a>
</div>
% endif
<div style="margin: 16px 8px 16px 8px; text-align: center;">
<a href="${object.website_url}"
style="background-color: #875a7b; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px;">View content</a>
</div>
Enjoy this exclusive content!
% if user.signature
<br />
${user.signature | safe}
% endif
</p>
</div>
</field>
<field name="auto_delete" eval="True"/>
</record>
<record id="slide_template_shared" model="mail.template">
<field name="name">Slide Shared</field>
<field name="model_id" ref="model_slide_slide"/>
<field name="subject">${user.name} shared a ${object.slide_type} with you!</field>
<field name="email_from">${user.email_formatted | safe}</field>
<field name="email_to">${ctx.get('email', '')}</field>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
Hello<br/><br/>
${user.name} shared the ${object.slide_type} <strong>${object.name}</strong> with you!
<div style="margin: 16px 8px 16px 8px; text-align: center;">
<a href="${(object.website_url + '?fullscreen=1') if ctx['fullscreen'] else object.website_url | safe}">
<img alt="${object.name}" src="${ctx['base_url']}/web/image/slide.slide/${object.id}/image_1024" style="height:auto; width:150px; margin: 16px;"/>
</a>
</div>
<div style="margin: 16px 8px 16px 8px; text-align: center;">
<a href="${(object.website_url + '?fullscreen=1') if ctx['fullscreen'] else object.website_url | safe}"
style="background-color: #875a7b; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px;">View <strong>${object.name}</strong></a>
</div>
% if user.signature
<br />
${user.signature | safe}
% endif
</p>
</div>
</field>
<field name="auto_delete" eval="True"/>
</record>
<!-- Completed Channel Message -->
<record id="mail_template_channel_completed" model="mail.template">
<field name="name">Completed Course</field>
<field name="model_id" ref="model_slide_channel_partner"/>
<field name="subject">Congratulation! You completed ${object.channel_id.name}</field>
<field name="email_from">${(object.channel_id.user_id.email_formatted or object.channel_id.user_id.company_id.catchall_formatted) | safe}</field>
<field name="partner_to">${object.partner_id.id}</field>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<div style="margin: 0px; padding: 0px; font-size: 13px;">
<p style="margin: 0px;">Hello ${object.partner_id.name},</p><br/>
<p><b>Congratulations!</b></p>
<p>You've completed the course <b>${object.channel_id.name}</b></p>
<p>Check out the other available courses.</p><br/>
<div style="margin: 16px 8px 16px 8px; text-align: center;">
<a href="/slides/all" style="background-color: #875a7b; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px;">
Explore courses
</a>
</div>
Enjoy this exclusive content!
% if object.channel_id.user_id.signature
<br />
${object.channel_id.user_id.signature | safe}
% endif
</div>
</div>
</field>
<field name="auto_delete" eval="True"/>
<field name="lang">${object.partner_id.lang}</field>
</record>
<!-- Slide channel invite feature -->
<record id="mail_template_slide_channel_invite" model="mail.template">
<field name="name">Channel: Invite by email</field>
<field name="model_id" ref="model_slide_channel_partner" />
<field name="subject">You have been invited to join ${object.channel_id.name}</field>
<field name="use_default_to" eval="True"/>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px; font-size: 13px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
Hello<br/><br/>
You have been invited to join a new course: ${object.channel_id.name}.
</p>
</div>
</field>
<field name="lang">${object.partner_id.lang}</field>
<field name="auto_delete" eval="True"/>
</record>
</data>
</odoo>