summaryrefslogtreecommitdiff
path: root/addons/gamification/data
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2016-11-24 17:52:59 +0100
committerThibault Delavallée <tde@odoo.com>2016-12-30 10:46:12 +0100
commit56645335b7bae0415242ec51193e493119a58879 (patch)
tree625418a8137438c0a78919624b35a569b9f5e572 /addons/gamification/data
parent64ea747824dc5580f35c8af904029139ef2fb4bc (diff)
[IMP] gamification: improve email sent when granting a badge
Give some details about the badge: its description, its image, who granted it, ... Otherwise it is quite complicated to understand the email content. Thanks to @mart-e who reviewed and tested.
Diffstat (limited to 'addons/gamification/data')
-rw-r--r--addons/gamification/data/badge.xml45
1 files changed, 34 insertions, 11 deletions
diff --git a/addons/gamification/data/badge.xml b/addons/gamification/data/badge.xml
index a928a342122..7af0b859048 100644
--- a/addons/gamification/data/badge.xml
+++ b/addons/gamification/data/badge.xml
@@ -42,19 +42,42 @@
<record id="email_template_badge_received" model="mail.template">
<field name="name">Received Badge</field>
+ <field name="subject">New badge ${object.badge_id.name} granted</field>
<field name="model_id" ref="gamification.model_gamification_badge_user"/>
+ <field name="partner_to">${object.user_id.partner_id.id}</field>
<field name="lang">${object.user_id.lang}</field>
- <field name="body_html"><![CDATA[
- <p>Congratulation, you have received the badge <strong>${object.badge_id.name}</strong> !
- % if object.sender_id
- This badge was granted by <strong>${object.sender_id.name}</strong>.
- % endif
- </p>
-
- % if object.comment
- <p><em>${object.comment}</em></p>
- % endif
- ]]></field>
+ <field name="body_html" type="xml">
+<div>
+ <p>Congratulations ${object.user_id.name} !</p>
+ <p>You just received badge <strong>${object.badge_id.name}</strong> !</p>
+</div>
+<div>
+% if object.badge_id.description
+<table cellspacing="0" cellpadding="0" border="0" style="width: 600px; margin-top: 5px;">
+<tbody><tr>
+ <td valign="center">
+ <img src="/web/image/gamification.badge/${object.badge_id.id}/image/80x80" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${user.company_id.name}"/>
+ </td>
+ <td valign="center">
+ <cite>${object.badge_id.description}</cite>
+ </td>
+</tr></tbody>
+</table>
+% endif
+</div>
+<div>
+ <p>
+% if object.sender_id
+ This badge was granted by <strong>${object.sender_id.name}</strong>.
+% endif
+ </p>
+ <p>
+% if object.comment
+ <em>${object.comment}</em>
+% endif
+ </p>
+</div>
+</field>
</record>
</data>
</odoo>