Hello Odoo Community,
I am currently working with Odoo SaaS version 17 and facing an issue with dynamically integrating survey responses into an email template. I'm limited to using the web interface for modifications and do not want to mess with backend access.
Environment:
- Odoo Version: Enterprise 17
- Hosting: odoo.sh
- Module: Survey
Objective: I need to customize an email template to include specific answers from a survey in the email content. The survey includes fields like "Requester Name," "Requester Email," "Software Name," and "Software Company." My goal is to dynamically populate these fields into the email template that gets triggered upon certain conditions (e.g., successful survey completion).
Challenges:
- Accessing and referencing specific survey response data within the email template.
- Ensuring the correct email address ("Requester Email") is used as the recipient of the email.
I have developed a custom email template in Odoo and am encountering difficulties with correctly referencing fields to ensure that emails are automatically populated with details upon the completion of a survey. We utilize the survey module to facilitate an audit process, allowing end-users to request audits for specific applications. Importantly, the person completing the survey is not the recipient of the results. Instead, the intended recipient's email and name are provided in the survey's answer fields.
Currently, I am facing challenges in ensuring that these answer fields correctly populate the email template. I need the template to dynamically include the survey responses, such as the requester's name and email, directly in the email sent out after survey completion. Despite my efforts, the email does not seem to pull and display this data as expected.
I need the answer to the second question "Requester Email" to populate for the To (Emails) field
{{ object.survey_id.user_input_line_ids[2].value_text }}
How do I reference the contents of the questions?
<p style="margin:0px 0 16px 0;box-sizing:border-box;">
Please find attached your
<strong t-out="object.survey_id.user_input_line_ids[3].value_text or ''" style="box-sizing:border-box;font-weight:bolder;">Software Company</strong>
certification
</p>
The end result will hopefully look like
Dear Requester Name, Please find attached the Software Company certification
The Software Software Name has passed the audit process.
Please note this audit is only approved for the related software and is not inclusive of other software solutions this company may produce.