Skip to Content
Menu
This question has been flagged
4 Replies
14339 Views

Hello, I'm having difficulties with e-mail templates. 

I tried to follow this tutorial: 

https://www.odoo.com/documentation/15.0/applications/productivity/discuss/advanced/email_template.html?highlight=templates

I used the dynamic placeholder generator and copied the generated placeholder expressions into the body of the email. When I tested it afterwards, the mail again showed the generated placeholder expressions instead of the desired outcome. 

Does anybody know where to find a more detailed documentation/tutorial on this?




Avatar
Discard

I found a way to solve the issue.
I am creating an email template from the email template menu accessible in developer mode.
There I can switch the editor to see the actual code behind the template.
From the code, I can replace the placeholders by their Web content.

My example : this si the code to get the name of the object contact :
<t t-out="object.name" data-oe-t-inline="true" style="box-sizing:border-box;" contenteditable="false"> </t>

There is a video that explains all this :
https://www.youtube.com/watch?v=VQJodqSE5DM

Hope it helps you to get it done !



Bonjour,

 

Je suis actuellement en congés avec un accès limité à ma messagerie.  Je répondrai à votre message dès mon retour le 27/02

 

Best Answer

I am facing a very similar issue.

When including the placeholder (i.e. Dear {{ object.display_name }}, ... ) in the email text :

- It works perfectly for the test message sent to myself

- It doesn't work at all when sending to a list of contacts selected based on some criteria (reproducing the code and not the content)


I found a way to solve the issue.
I am creating an email template from the email template menu accessible in developer mode.
There I can switch the editor to see the actual code behind the template.
From the code, I can replace the placeholders by their QWeb content.

My example : this is the code to get the name of the object contact : 

" see comment up - as the t-out is processed in the answer ;-) "

There is a video that explains all this : 
https://www.youtube.com/watch?v=VQJodqSE5DM

Hope it helps you to get it done !


Avatar
Discard
Best Answer

How is it possible that Odoo has not fixed this yet ?? Unbelievable ... 

Avatar
Discard
Best Answer

Hello there,

I've tried both, the documentation (did not work) and the suggestion made by Mohd (did not work either).

Is there somebody with suggestions about this??

Avatar
Discard
Best Answer

Hi,

Odoo 15 now deprecated Jinja Templating which was used in Odoo14 and earlier versions.

Odoo now uses QWEB templating and introduced special t-out tag for same.

How to use it with expression generator ?

1. Lets say you expression is : {{ object.name }}

2. Go to edit more(code mode) and syntax (i.e excluding curly braces)

  

3. Save the template.

4. Preview

Let me know if any issues are faced.

Avatar
Discard

Hello,

I have the same problem in Odoo 16, could you please specify where can I find this:
2. Go to edit more(code mode) and syntax (i.e excluding curly braces)
(I believe something is wrong with our view also, because we don't have the "dynamic placeholder generator everyone mentions), the palceholders I used I had to copy them from other user samples.
(Odoo v.16)

Thank you!

Related Posts Replies Views Activity
0
Jul 24
718
1
Sep 23
1332
1
Jun 23
2462
1
Mar 24
3516
0
Nov 22
1832