[IMP] mail: Improved email notification template

Shorter template, cleaner look. Warn about internal note messages.
This commit is contained in:
Fabien Pinckaers
2016-07-16 23:57:55 +02:00
parent b98bb6d10f
commit 069a192d69
2 changed files with 69 additions and 136 deletions
+68 -136
View File
@@ -60,156 +60,88 @@
<field name="model_id" ref="mail.model_mail_message"/>
<field name="auto_delete" eval="True"/>
<field name="body_html"><![CDATA[
% if ctx.get('button_access'):
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="potentialAction" itemscope itemtype="http://schema.org/ViewAction">
% if ctx.get('button_access'):
<link itemprop="target" href="${ctx['button_access']['url']}"/>
<link itemprop="url" href="${ctx['button_access']['url']}"/>
% endif
<meta itemprop="name" content="View ${ctx['model_name']}"/>
</div>
</div>
% endif
% if not ctx['is_discussion'] or not len(ctx['actions']) == 0 or ctx.get('is_accessible'):
<div summary="o_mail_notification" style="padding:0px; width:600px; margin:0 auto; background: #FFFFFF repeat top /100%;color:#777777">
<table cellspacing="0" cellpadding="0" style="width:600px; border-collapse:collapse; background:inherit; color:inherit">
<tbody><tr>
<td valign="center" width="200" style="padding:0px 10px 5px 5px; font-size: 12px">
<img src="/logo.png" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${user.company_id.name}">
</td>
<td valign="center" align="right" width="340" style="padding:0px 10px 5px 5px; font-size: 12px;">
<p>
% if ctx.get('button_access') or ctx.get('button_follow') or ctx.get('button_unfollow'):
<a href="${ctx['button_access']['url']}" style="padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#a24689; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; background-image: none; background-color: #a24689; border: 1px solid #a24689; border-radius:3px"><strong>${ctx['button_access']['title']}</strong></a>
% endif
<div summary="o_mail_notification">
<table cellspacing="0" cellpadding="0" border="0" style="width: 100%; margin-top: 5px;">
<tbody><tr>
<td valign="center">
% if ctx.get('button_access') or ctx.get('button_follow') or ctx.get('button_unfollow'):
<a href="${ctx['button_access']['url']}" style="padding: 8px 12px; font-size: 12px; text-decoration: none; color: #FFFFFF; text-decoration:none !important; font-weight: 400; background-color: #a24689; border: 0px solid #a24689; border-radius:3px">${ctx['button_access']['title']}</a>
% endif
% if ctx.get('button_follow'):
% if ctx.get('actions'):
|
% endif
<a href="${ctx['button_follow']['url']}" style="text-decoration:none; color: #a24689;">${ctx['button_follow']['title']}</a>
% elif ctx.get('button_unfollow'):
% if ctx.get('actions'):
|
% endif
<a href="${ctx['button_unfollow']['url']}" style="text-decoration:none; color: #a24689;">${ctx['button_unfollow']['title']}</a>
% endif
% if ctx.get('button_follow'):
% if ctx.get('actions'):
|
% endif
<a href="${ctx['button_follow']['url']}" style="text-decoration:none; color: #a24689; text-decoration:none !important;">${ctx['button_follow']['title']}</a>
% elif ctx.get('button_unfollow'):
% if ctx.get('actions'):
|
% endif
<a href="${ctx['button_unfollow']['url']}" style="text-decoration:none; color: #a24689; text-decoration:none !important;">${ctx['button_unfollow']['title']}</a>
% endif
% if ctx.get('actions'):
|
% for action in ctx['actions']:
<a href="${action['url']}" style="text-decoration:none; color: #a24689;">${action['title']}</a>
% endfor
% endif
</p>
</td>
</tr>
</tbody></table>
% if ctx.get('actions'):
% for action in ctx['actions']:
|
<a href="${action['url']}" style="text-decoration:none; color: #a24689; text-decoration:none !important;">${action['title']}</a>
% endfor
% endif
</td>
<td valign="center" align="right">
<img src="/logo.png" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${user.company_id.name}">
</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:10px 0;">
% if ctx.get('subtype') and ctx.get('subtype').internal:
<span style="background-color: #f2dede; padding: 5px;">
<strong>Internal note</strong>: replies are not sent to followers.
</span>
% endif
</td>
</tr>
</tbody></table>
</div>
<div summary="o_mail_notification" style="padding:0px; width:600px; margin:0 auto; background: #FFFFFF repeat top /100%;color:#777777">
<table cellspacing="0" cellpadding="0" style="vertical-align:top; padding:0px; border-collapse:collapse; background:inherit; color:inherit">
<tbody><tr>
<td valign="top" style="width:600px; padding:0px 10px 5px 5px;">
<div>
<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:0px auto;padding:0">
</div>
</td>
</tr></tbody>
</table>
</div>
<div style="padding:0px; width:600px; max-width:600px; margin:0 auto; background: #FFFFFF repeat top /100%; color:#777777">
% else:
<div style="padding:0px; width:600px; max-width:600px; margin:0 auto; background: #FFFFFF repeat top /100%;>
% endif
<table cellspacing="0" cellpadding="0" style="width:600px ;text-align:justify; margin:0 auto; border-collapse:collapse; background:inherit; color:inherit">
<tbody>
% if not ctx['is_discussion'] or not len(ctx['actions']) == 0:
<tr>
<td style="padding:0px 10px 5px 5px;font-size: 14px;">
${object.body | safe}
% if ctx.get('tracking'):
<ul>
% for tracking in ctx['tracking']
<li>${tracking[0]} : ${tracking[1]} -&gt; ${tracking[2]}</li>
% endfor
</ul>
% endif
</td>
</tr>
% else:
<tr>
<td style="font-size: 14px;">
${object.body | safe}
% if ctx.get('tracking'):
<ul>
% for tracking in ctx['tracking']
<li>${tracking[0]} : ${tracking[1]} -&gt; ${tracking[2]}</li>
% endfor
</ul>
% endif
</td>
</tr>
% endif
</tbody>
</table>
</div>
% if not ctx['is_discussion'] or not len(ctx['actions']) == 0:
<div style="padding:0px; width:600px; max-width:600px; margin:0 auto; background: #FFFFFF repeat top /100%;color:#777777">
% else:
<div style="padding:0px; width:600px; max-width:600px; margin:0 auto; background: #FFFFFF repeat top /100%;>
${object.body | safe}
% if ctx.get('tracking'):
<ul>
% for tracking in ctx['tracking']
<li>${tracking[0]} : ${tracking[1]} -&gt; ${tracking[2]}</li>
% endfor
</ul>
% endif
<table cellspacing="0" cellpadding="0" style="width:600px ;text-align:justify; margin:0 auto; border-collapse:collapse; background:inherit; color:inherit">
<tbody>
% if ctx.get('signature'):
% if not ctx['is_discussion'] or not len(ctx['actions']) == 0:
<tr>
<td style="padding:0px 10px 5px 5px;font-size: 14px; text-align: left;">
${ctx['signature'] | safe}
</td>
</tr>
% else:
<tr>
<td style="font-size: 14px; text-align: left;">
${ctx['signature'] | safe}
</td>
</tr>
% endif
% endif
% if not ctx['is_discussion'] or not len(ctx['actions']) == 0:
<tr>
<td style="padding:0px 10px 5px 5px;font-size: 11px; text-align: left;">
<strong>Sent by</strong>
% if ctx.get('website_url'):
<a href="${ctx['website_url']}" style="text-decoration:none; color: #a24689;">
% endif
<strong>${ctx.get('company_name')}</strong>
% if ctx.get('website_url'):
</a>
% endif
<strong>using</strong>
<a href="https://www.odoo.com" style="text-decoration:none; color: #a24689;"><strong>Odoo</strong></a>
</td>
</tr>
% else:
<tr>
<td style="font-size: 14px; text-align: left;">
<strong>Sent by</strong>
% if ctx.get('website_url'):
<a href="${ctx['website_url']}" style="text-decoration:none;">
% endif
<strong>${ctx.get('company_name')}</strong>
% if ctx.get('website_url'):
</a>
% endif
<strong>using</strong>
<a href="https://www.odoo.com" style="text-decoration:none;"><strong>Odoo</strong></a>
</td>
</tr>
% endif
</tbody>
</table>
</div>]]></field>
% if ctx.get('signature'):
${ctx['signature'] | safe}
% endif
<br/>
<p style="color: #555555;">
Sent by
% if ctx.get('website_url'):
<a href="${ctx['website_url']}" style="text-decoration:none; color: #a24689;">
% endif
${ctx.get('company_name')}
% if ctx.get('website_url'):
</a>
% endif
using
<a href="https://www.odoo.com" style="text-decoration:none; color: #a24689;">Odoo</a>.
</p>
]]></field>
</record>
</data>
+1
View File
@@ -83,6 +83,7 @@ class Partner(models.Model):
'record_name': record_name,
'tracking': tracking,
'is_discussion': is_discussion,
'subtype': message.subtype_id,
'is_accessible': message._is_accessible()
}