summaryrefslogtreecommitdiff
path: root/addons/survey/data/mail_template_data.xml
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2018-12-17 17:01:20 +0000
committerThibault Delavallée <tde@odoo.com>2019-01-14 15:22:18 +0000
commit7d110c20c55b34712e644b3ee9b248a26c490caa (patch)
tree0b003bda46b5daef7a67f01fcba9cece58f7962a /addons/survey/data/mail_template_data.xml
parent6fa46886931b29e4e7130c04d133657f3dffd6e3 (diff)
[REF] survey: refactor template use on invite wizard
Purpose of this merge is to remove the ugly __URL__ hack of survey templates. It is solved by making template rendered on user_input model. This means each invitation recipient will received its own rendered mail. Small jinja code allows therefore to include the url in a clean odoo-style way. Subject and body in survey invite wizard are not rendered anymore. It means jinja could be displayed. This is necessary as this wizard will work in batch mode, rendering the body on each recipient. This commit is linked to task ID 1911586 and PR #28986.
Diffstat (limited to 'addons/survey/data/mail_template_data.xml')
-rw-r--r--addons/survey/data/mail_template_data.xml15
1 files changed, 8 insertions, 7 deletions
diff --git a/addons/survey/data/mail_template_data.xml b/addons/survey/data/mail_template_data.xml
index 08b6d4403c4..66f81771c74 100644
--- a/addons/survey/data/mail_template_data.xml
+++ b/addons/survey/data/mail_template_data.xml
@@ -1,22 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
- <record id="email_template_survey" model="mail.template">
+ <record id="mail_template_user_input_invite" model="mail.template">
<field name="name">Survey: Send by email</field>
- <field name="model_id" ref="model_survey_survey" />
- <field name="subject">${object.title}: Survey</field>
+ <field name="model_id" ref="model_survey_user_input" />
+ <field name="subject">Participate to ${object.survey_id.title} survey</field>
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px; font-size: 13px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
- Hello<br /><br />
- We are conducting a survey, and your response would be appreciated.
+ Dear ${object.partner_id.name or 'participant'}<br/><br/>
+ We are conducting a survey and your response would be appreciated.
<div style="margin: 16px 0px 16px 0px;">
- <a href="__URL__"
+ <a href="${('%s?token=%s' % (object.survey_id.public_url, object.token)) | safe}"
style="background-color: #875A7B; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px; font-size:13px;">
Start Survey
</a>
</div>
- Thanks for your participation!
+ Please answer the appraisal for ${format_date(object.deadline)}.<br/><br/>
+ Thank you for your participation.
</p>
</div>
</field>