Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
777 Zobrazení

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

Avatar
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
zář 23
1224
0
lis 24
758
0
čvn 24
1269
2
lis 24
1605
0
pro 23
1047