[REF] various: make mako mail templates more xml compliant
As we will soon improve the sanitizer we will be able to sanitize email templates body. However this implies some cleaning in the templates to be sure mako is not considered as invalid html / xml and therefore removed from the template body.
This commit is contained in:
@@ -16,10 +16,10 @@
|
||||
<field name="report_name">Invoice_${(object.number or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''}</field>
|
||||
<field name="lang">${object.partner_id.lang}</field>
|
||||
<field name="body_html"><![CDATA[
|
||||
<p>Dear ${object.partner_id.name}
|
||||
% set access_action = object.get_access_action()
|
||||
% set access_url = access_action['type'] == 'ir.actions.act_url' and access_action['url'] or '/report/pdf/account.report_invoice/' + str(object.id)
|
||||
|
||||
<p>Dear ${object.partner_id.name}
|
||||
% if object.partner_id.parent_id:
|
||||
(<i>${object.partner_id.parent_id.name}</i>)
|
||||
% endif
|
||||
|
||||
@@ -81,8 +81,8 @@
|
||||
<field name="partner_to">${object.partner_id and object.partner_id.email and object.partner_id.email==object.email and object.partner_id.id or False }</field>
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="body_html"><![CDATA[
|
||||
% set colors = {'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'}
|
||||
<div summary="o_mail_template" style="padding:0px;width:600px;margin:auto;background: #FFFFFF repeat top /100%;color:#777777">
|
||||
% set colors = {'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'}
|
||||
<table cellspacing="0" cellpadding="0" style="width:600px;border-collapse:collapse;background:inherit;color:inherit">
|
||||
<tbody><tr>
|
||||
<td valign="center" width="200" style="padding:10px 10px 10px 5px;font-size: 12px">
|
||||
@@ -172,8 +172,8 @@
|
||||
<field name="partner_to">${object.partner_id and object.partner_id.email and object.partner_id.email==object.email and object.partner_id.id or False }</field>
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="body_html"><![CDATA[
|
||||
% set colors = {'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'}
|
||||
<div summary="o_mail_template" style="padding:0px;width:600px;margin:auto;background: #FFFFFF repeat top /100%;color:#777777">
|
||||
% set colors = {'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'}
|
||||
<table cellspacing="0" cellpadding="0" style="width:600px;border-collapse:collapse;background:inherit;color:inherit">
|
||||
<tbody><tr>
|
||||
<td valign="center" width="200" style="padding:10px 10px 10px 5px;font-size: 12px">
|
||||
@@ -264,8 +264,8 @@
|
||||
<field name="partner_to">${object.partner_id and object.partner_id.email and object.partner_id.email==object.email and object.partner_id.id or False }</field>
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="body_html"><![CDATA[
|
||||
% set colors = {'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'}
|
||||
<div summary="o_mail_template" style="padding:0px;width:600px;margin:auto;background: #FFFFFF repeat top /100%;color:#777777">
|
||||
% set colors = {'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'}
|
||||
<table cellspacing="0" cellpadding="0" style="width:600px;border-collapse:collapse;background:inherit;color:inherit">
|
||||
<tbody><tr>
|
||||
<td valign="center" width="200" style="padding:10px 10px 10px 5px;font-size: 12px">
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="scheduled_date">${(datetime.datetime.now() + relativedelta(days=2)).strftime('%Y-%m-%d %H:%M')}</field>
|
||||
<field name="body_html" ><![CDATA[
|
||||
% set last_created_team = user.env['crm.team'].search([], order="create_date desc")[0]
|
||||
|
||||
<div style="margin: 10px auto;">
|
||||
% set last_created_team = user.env['crm.team'].search([], order="create_date desc")[0]
|
||||
<table cellspacing="0" cellpadding="0" style="width:100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
<field name="reply_to">${object.event_id.reply_to|safe}</field>
|
||||
<field name="subject">Your registration at ${object.event_id.name}</field>
|
||||
<field name="body_html"><![CDATA[
|
||||
<div style="background:#F3F5F6;color:#515166;padding:25px 0px;font-family:Arial,Helvetica,sans-serif;font-size:14px;">
|
||||
% set date_begin = format_tz(object.event_id.date_begin, tz='UTC', format='%Y%m%dT%H%M%SZ')
|
||||
% set date_end = format_tz(object.event_id.date_end, tz='UTC', format='%Y%m%dT%H%M%SZ')
|
||||
<div style="background:#F3F5F6;color:#515166;padding:25px 0px;font-family:Arial,Helvetica,sans-serif;font-size:14px;">
|
||||
<table style="width:600px;margin:5px auto;">
|
||||
<tbody>
|
||||
<tr>
|
||||
@@ -157,9 +157,9 @@
|
||||
<field name="reply_to">${object.event_id.reply_to|safe}</field>
|
||||
<field name="subject">Reminder for ${object.event_id.name}</field>
|
||||
<field name="body_html"><![CDATA[
|
||||
<div style="background:#F3F5F6;color:#515166;padding:25px 0px;font-family:Arial,Helvetica,sans-serif;font-size:14px;">
|
||||
% set date_begin = format_tz(object.event_id.date_begin, tz='UTC', format='%Y%m%dT%H%M%SZ')
|
||||
% set date_end = format_tz(object.event_id.date_end, tz='UTC', format='%Y%m%dT%H%M%SZ')
|
||||
<div style="background:#F3F5F6;color:#515166;padding:25px 0px;font-family:Arial,Helvetica,sans-serif;font-size:14px;">
|
||||
<table style="width:600px;margin:5px auto;">
|
||||
<tbody>
|
||||
<tr>
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
<field name="model_id" ref="mail.model_mail_message"/>
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="body_html"><![CDATA[
|
||||
<div>
|
||||
% if ctx.get('button_access'):
|
||||
<div itemscope itemtype="http://schema.org/EmailMessage">
|
||||
<div itemprop="potentialAction" itemscope itemtype="http://schema.org/ViewAction">
|
||||
@@ -140,7 +141,7 @@ ${object.body | safe}
|
||||
using
|
||||
<a href="https://www.odoo.com" style="text-decoration:none; color: #a24689;">Odoo</a>.
|
||||
</p>
|
||||
]]></field>
|
||||
</div>]]></field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
||||
@@ -12,9 +12,8 @@
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="scheduled_date">${(datetime.datetime.now() + relativedelta(days=3)).strftime('%Y-%m-%d %H:%M')}</field>
|
||||
<field name="body_html" ><![CDATA[
|
||||
% set last_created_project = user.env['project.project'].search([('alias_id','<>',False)], order="create_date desc")[0]
|
||||
|
||||
<div style="margin: 10px auto;">
|
||||
% set last_created_project = user.env['project.project'].search([('alias_id','!=',False)], order="create_date desc")[0]
|
||||
<table cellspacing="0" cellpadding="0" style="width:100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
<field name="partner_to" >${object.rating_get_partner_id().id}</field>
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="body_html"><![CDATA[
|
||||
% set access_token = object.rating_get_access_token()
|
||||
<div style="background:#F0F0F0;color:#515166;padding:10px 0px;font-family:Arial,Helvetica,sans-serif;font-size:14px;">
|
||||
% set access_token = object.rating_get_access_token()
|
||||
<table style="width:600px;margin:5px auto;">
|
||||
<tbody>
|
||||
<tr><td>
|
||||
|
||||
@@ -14,12 +14,13 @@
|
||||
<field name="report_name">${(object.name or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''}</field>
|
||||
<field name="lang">${object.partner_id.lang}</field>
|
||||
<field name="body_html"><![CDATA[
|
||||
<p>Dear ${object.partner_id.name}
|
||||
% set access_action = object.get_access_action()
|
||||
% set doc_name = 'quotation' if object.state in ('draft', 'sent') else 'order confirmation'
|
||||
% set is_online = access_action and access_action['type'] == 'ir.actions.act_url'
|
||||
% set access_name = is_online and object.template_id and 'Accept and pay %s online' % doc_name or 'View %s' % doc_name
|
||||
% set access_url = is_online and access_action['url'] or object.get_signup_url()
|
||||
<p>Dear ${object.partner_id.name}
|
||||
|
||||
% if object.partner_id.parent_id:
|
||||
(<i>${object.partner_id.parent_id.name}</i>)
|
||||
% endif
|
||||
|
||||
Reference in New Issue
Block a user