Skip to Content
Menu
This question has been flagged
1 Atsakyti
818 Rodiniai

The dynamic values are not being replaced by actual values, When I receive emails. Please Help.

Dear {{ object.partner_id.display_name }},


Your subscription {{ object.name }} has been marked for renewal.

Please review your subscription details. 


Thank you!

Request was: We would like to create a notification that is emailed when a subscription has the tag “renew” - a tag Odoo automatically applies to the sub .

What I did: I created an automated action. 
Model: Subcription
Trigger: On update
Before Update Domain: Tags> Analytic Tag = "renew"
Action To do: Send Email

That is my configuration

Portretas
Atmesti
Best Answer

Hi,

The issue is that the dynamic values like {{ object.partner_id.display_name }} are written in Jinja syntax, which isn’t supported in Odoo's body_html email template field.


To fix this, use the QWeb-compatible t-out syntax instead. Here's how your email body should look:



<p>Dear <t t-out="object.partner_id.display_name" />,</p>


<p>Your subscription <t t-out="object.name" /> has been marked for renewal.</p>


<p>Please review your subscription details.</p>


<p>Thank you!</p>


This will ensure the actual values are rendered properly when the email is sent. Make sure your template is set to use QWeb and linked correctly in your automated action.

Hope it helps

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
0
rugs. 23
1254
0
lapkr. 24
776
0
birž. 24
1318
2
lapkr. 24
1652
0
gruod. 23
1082