To encourage forum and slides users to be more active ranks are now added. They are directly linked to karma. The more the user has karma the more his rank will be high. The default rank is Newbie, with 1 point of karma. Users with 0 karma are considered as inactive on forum or slides. When a user reach a new rank a mail is sent to him to congratulate him with his new rank. To add a button in the mail template to allow users to go directly on a website section (like forum or slides) simply override get_gamification_redirection_data to add the target url. Partial commit linked to eLearning project. Main specifications related to gamification and user profile can be found on task 1922159 (PR #30514). Main specifications related to eLearning can be found on task 1902304 (PR #29876).
52 lines
2.8 KiB
XML
52 lines
2.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<data>
|
|
<record id="mail_template_data_new_rank_reached" model="mail.template">
|
|
<field name="name">New rank reached</field>
|
|
<field name="model_id" ref="base.model_res_users"/>
|
|
<field name="subject">Reception of ${object.name}</field>
|
|
<field name="email_to">${(object.partner_id.email_formatted or object.email) |safe}</field>
|
|
<field name="partner_to">${object.partner_id.id}</field>
|
|
<field name="subject">New rank: ${object.rank_id.name}</field>
|
|
<field name="lang">${object.partner_id.lang}</field>
|
|
<field name="auto_delete" eval="True" />
|
|
<field name="body_html" type="html">
|
|
<div style="background:#F0F0F0;color:#515166;padding:10px 0px;font-family:Arial,Helvetica,sans-serif;font-size:14px;">
|
|
<table style="width:600px;margin:0px auto;background:white;border:1px solid #e1e1e1;">
|
|
<tbody>
|
|
<tr>
|
|
<td style="padding:15px 20px 10px 20px;">
|
|
<p>
|
|
Congratulations
|
|
<span>${object.partner_id.name or ''}</span>!
|
|
</p>
|
|
<p>
|
|
You just reached a new rank : <strong>${object.rank_id.name}</strong>
|
|
</p>
|
|
<p>Continue your work to become a <strong>${object.next_rank_id.name}</strong> !</p>
|
|
<div style="margin: 16px 0px 16px 0px;">
|
|
% set gamification_redirection_data = object.get_gamification_redirection_data()
|
|
% for data in gamification_redirection_data
|
|
% set url = data['url']
|
|
% set label = data['label']
|
|
<a href="${url}" style="background-color: #875A7B; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px; font-size:13px;">${label}</a>
|
|
% endfor
|
|
</div>
|
|
</td>
|
|
<td style="padding:15px 20px 10px 20px;">
|
|
<p style="text-align: center;">
|
|
<img src="/web/image/gamification.karma.rank/${object.rank_id.id}/image_medium"/>
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
Thank you,<br/>
|
|
</div>
|
|
</field>
|
|
</record>
|
|
</data>
|
|
</odoo>
|