Skip to content

Commit f3fe33c

Browse files
committed
[IMP] website_sale: fine-tunes sale order rating mail template
task-5261265
1 parent 969f1b1 commit f3fe33c

File tree

1 file changed

+26
-15
lines changed

1 file changed

+26
-15
lines changed

addons/website_sale/data/mail_template_data.xml

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -221,38 +221,49 @@
221221
<field name="email_layout_xmlid">mail.mail_notification_light</field>
222222
<field name="body_html" type="html">
223223
<div style="margin: 0px; padding: 0px;">
224-
<p style="margin: 0px; padding: 0px; font-size: 12px;">
225-
Hello <t t-out="object.partner_id.name"/>,
226-
<br/>
224+
<t t-set="secondary_color" t-value="object.company_id.email_secondary_color or '#875A7B'"/>
225+
<t t-set="primary_color" t-value="object.company_id.email_primary_color or '#FFFFFF'"/>
226+
<t
227+
t-if="'website_id' in object and object.website_id"
228+
t-set="logo_src"
229+
t-value="object.website_id.image_url(object.website_id, 'logo')"
230+
/>
231+
<t t-else="" t-set="logo_src" t-valuef="/logo.png?company=#{object.company_id.id}"/>
232+
<img t-att-src="logo_src" style="display: block; height: 50px; margin: 0 0 16px;" alt="Logo"/>
233+
<p style="margin: 0 0 12px; padding: 0px; line-height: 18px; font-size: 14px;">
234+
Hello <t t-out="object.partner_id.display_name"/>,
235+
<br/><br/>
227236
Take a minute to rate your order!
228237
<br/>
229238
<t t-if="not is_html_empty(object.user_id.signature)">
230-
<div>--<br/><t t-out="object.user_id.signature"/></div>
239+
<div style="font-size: 14px; margin: 0 0 16px;"><t t-out="object.user_id.signature"/></div>
231240
</t>
232241
<br/>
233242
<t t-foreach="object.order_line.filtered(lambda l: l._is_sellable())" t-as="line">
234243
<t t-set="product" t-value="line.product_id"/>
235-
<table width="35%" style="color: #454748; font-size: 12px; border-collapse: collapse; margin-bottom: 15px;">
244+
<table width="100%" t-attf-style="font-size: 14px; border-collapse: collapse; margin-bottom: 10px; max-width: 590px; {{not line_last and 'border-bottom: 1px solid #dee2e6;'}}">
236245
<tr>
237-
<td style="width: 100px; vertical-align: top;">
246+
<td style="width: 84px; padding: 10px 10px 10px 0; vertical-align: top;">
238247
<img
239248
t-attf-src="/web/image/product.product/{{ product.id }}/image_128"
240249
t-attf-style="width: 64px; height: {{object.website_id and object.website_id._get_product_image_ratio_height() or '64px'}}; object-fit: cover; object-position: center;"
241250
alt="Product image"
242251
/>
243252
</td>
244-
<td style="padding-left: 10px; vertical-align: top; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">
245-
<div style="font-weight: bold; margin-bottom: 5px;">
246-
<t t-out="product.name"/>
253+
<td style="padding: 10px 10px 10px 0;">
254+
<div>
255+
<h3 t-attf-style="font-size: 14px; margin-bottom: {{line.product_id.product_template_attribute_value_ids and '6px' or '0'}};">
256+
<strong t-attf-style="color: {{secondary_color}};" t-out="product.name"/>
257+
</h3>
247258
</div>
248-
<div style="font-size: 11px; color: #666;">
249-
<t t-out="product.description_sale or ''"/>
259+
<div>
260+
<span t-if="line.product_id.product_template_attribute_value_ids" style="color: #6c757d;">
261+
<t t-out="', '.join(line.product_id.product_template_attribute_value_ids.mapped('name'))" />
262+
</span>
250263
</div>
251264
</td>
252-
<td style="width: 120px; padding-left: 10px; vertical-align: middle; text-align: center;">
253-
<a t-att-href="product.website_absolute_url + '#o_product_page_reviews'"
254-
style="background-color:#875A7B;color:white;padding:10px 15px;text-decoration:none;border-radius:4px;display:inline-block;font-weight:bold;"
255-
target="_blank">
265+
<td style="padding: 10px 0; text-align: right;">
266+
<a t-att-href="product.website_absolute_url + '#o_product_page_reviews'" t-attf-style="border-radius: 5px; background-color: {{secondary_color}}; padding: 8px 16px 8px 16px; color: {{primary_color}}; text-decoration: none; font-size:13px; white-space: nowrap;" target="_blank">
256267
Review Now
257268
</a>
258269
</td>

0 commit comments

Comments
 (0)