Purpose of this commit is to use an access token to access survey instead of their ID. Routes are updated to use that token instead of the survey ID. Purpose is to have less discoverable routes and be able to control a bit more survey access even if it is not really a security parameter. Some renaming is performed to avoid confusion in terms. Survey token and answer token are now clearly labeled differently in the code to know which model we are working on. Some templates are updated to directly use the answer as base record to have access to token and test_entry fields instead of giving those parameter values directly in the controller. It makes some more diff but also allow easier edition and improvement in templates when having directly survey and answer record available. This commit is linked to task ID 1932508 and PR #30508.
31 lines
1.4 KiB
XML
31 lines
1.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<data noupdate="1">
|
|
<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_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;">
|
|
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="${('%s?answer_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>
|
|
% if object.deadline:
|
|
Please answer the survey for ${format_date(object.deadline)}.<br/><br/>
|
|
% endif
|
|
Thank you for your participation.
|
|
</p>
|
|
</div>
|
|
</field>
|
|
<field name="auto_delete" eval="True"/>
|
|
<field name="user_signature" eval="False"/>
|
|
</record>
|
|
|
|
</data>
|
|
</odoo> |