In this commit we improve templates used in website_slides. Purpose of this commit
is to have templates that embed or use standard Odoo email layouts to make
them look modern and have a common style across all emails.
Main guidelines
* better use of div / p / br to try to lessen layout issues, especially
when updating templates using the editor;
* correctly sequence the templates fields definition;
* correctly set templates values notably auto_delete and user_signature
fields to avoid confusion;
* correctly layout the email content using light notification email. It
can either propagate the layout choice through various send mail methods
or directly embed the styling in the templates for more technical or
complex templates;
* use email_formatted computed field when possible to avoid having hand-made
from / to addresses;
* fix various typos and improve subjects when necessary;
Content of emails is not necessarily updated as the purpose of this task is
about styling, not content itself.
This commit is linked to task ID 1843376 (and 1868112) and closes PR #25349
(and #25889).
111 lines
5.5 KiB
XML
111 lines
5.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<data noupdate="1">
|
|
|
|
<record model="ir.config_parameter" id="google_app_key">
|
|
<field name="key">website_slides.google_app_key</field>
|
|
<field name="value">AIzaSyDOWlmDW-7DbLmOR9ZsT5AOEXf4n6TFwQA</field>
|
|
</record>
|
|
|
|
<record id="website_menu_slides" model="website.menu">
|
|
<field name="name">Presentations</field>
|
|
<field name="url">/slides</field>
|
|
<field name="parent_id" ref="website.main_menu"/>
|
|
<field name="sequence" type="int">50</field>
|
|
</record>
|
|
|
|
<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/>
|
|
A new ${object.slide_type} <strong>${object.name}</strong> has been published on ${object.channel_id.name} at ${format_tz(object.write_date, tz=user.tz)}
|
|
<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" style="height:auto; width:150px; margin: 16px;"/>
|
|
</a>
|
|
</div>
|
|
<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 <strong>${object.name}</strong></a>
|
|
</div>
|
|
</p>
|
|
</div>
|
|
</field>
|
|
<field name="auto_delete" eval="True"/>
|
|
<field name="user_signature" 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 or '')|safe}</field>
|
|
<field name="email_to">${ctx['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}">
|
|
<img alt="${object.name}" src="${ctx['base_url']}/web/image/slide.slide/${object.id}/image" style="height:auto; width:150px; margin: 16px;"/>
|
|
</a>
|
|
</div>
|
|
<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 <strong>${object.name}</strong></a>
|
|
</div>
|
|
</p>
|
|
</div>
|
|
</field>
|
|
<field name="auto_delete" eval="True"/>
|
|
<field name="user_signature" eval="True"/>
|
|
</record>
|
|
|
|
<record model="slide.channel" id="channel_public">
|
|
<field name="name">Public Channel</field>
|
|
<field name="promote_strategy">most_viewed</field>
|
|
<field name="website_published" eval="True"/>
|
|
<field name="visibility">public</field>
|
|
<field name="description">Default channel for slides, all public users can access content of this channel.</field>
|
|
</record>
|
|
<record model="slide.channel" id="channel_partial">
|
|
<field name="name">Partner Channel</field>
|
|
<field name="website_published" eval="True"/>
|
|
<field name="group_ids" eval="[(4, ref('base.group_portal')), (4, ref('base.group_user'))]"/>
|
|
<field name="upload_group_ids" eval="[(4, ref('base.group_user'))]"/>
|
|
<field name="visibility">partial</field>
|
|
<field name="description">Used to publish slides in partner network privately.</field>
|
|
</record>
|
|
<record model="slide.channel" id="channel_private">
|
|
<field name="name">Employee Channel</field>
|
|
<field name="group_ids" eval="[(4, ref('base.group_user'))]"/>
|
|
<field name="visibility">private</field>
|
|
<field name="description">Used to publish internal slides of company.</field>
|
|
</record>
|
|
|
|
<!-- Channel subtypes -->
|
|
<record id="mt_channel_slide_published" model="mail.message.subtype">
|
|
<field name="name">Presentation Published</field>
|
|
<field name="res_model">slide.channel</field>
|
|
<field name="default" eval="True"/>
|
|
<field name="description">Presentation Published</field>
|
|
</record>
|
|
|
|
<!-- jump to Channel on installation complete -->
|
|
<record id="action_open_channels" model="ir.actions.act_url">
|
|
<field name="name">Channels</field>
|
|
<field name="target">self</field>
|
|
<field name="url" eval="'/slides'"/>
|
|
</record>
|
|
<record id="base.open_menu" model="ir.actions.todo">
|
|
<field name="action_id" ref="action_open_channels"/>
|
|
<field name="state">open</field>
|
|
</record>
|
|
</data>
|
|
</odoo>
|