跳至內容
選單
此問題已被標幟
1 回覆
743 瀏覽次數

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

頭像
捨棄
最佳答案

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
9月 23
1207
0
11月 24
729
0
6月 24
1246
2
11月 24
1536
0
12月 23
1007