Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
10530 Widoki

I have a customer that is using the email marketing app.  He creates campaigns for his clients and he needs to personalize emails for each one adding tittle and name.

Awatar
Odrzuć
Autor Najlepsza odpowiedź


Here is a workaround to insert dynamic fields in the email templates using the Dynamic Placeholder Generator and a piece of code.

Previous configuration: be sure you are using the debug mode.

  1. Identify the related field you want to use. E.g. contact name

  2. Use the Dynamic Placeholder Generator to generate the Placeholder expression.


       3. If you need to display the placeholder in the email subject, use the Placeholder Expression as it appears. 


    4. If you need to display the placeholder in the mail body:

    1.  Go to the code and insert the following piece of code in the place you need. 


                b. Add the placeholder expression without the brackets and change the contenteditable as you need.


                c. Go back to the normal view, save and test it!



You are ready to personalize your mass mailing emails!

Few reminders:

  1. It is not possible to use the Dynamic Placeholders in V15 as we used to do it in V14.

  2. We can still use dynamic fields (expressions). For example: contact name, the SO or PO total amount. Therefore, it is a technical procedure.

  3. Remember that adding a conditional (if, elif, etc) writing code, it is considered a development. Please don't do it!

  4. If the number of sent emails is over 400 per day or your customer has a high email bounce rate you should consider configuring an external email server.


Awatar
Odrzuć

V15 can't using this feature?

We want some dynamic field insert into the email content, not only for email object.

looks like t elements are not rendered to thml in this process
so think will not work like that in 15

Just tested this in v16 (on Odoo.sh), and works fine with t-element in html-body. Still needs to work in debug-mode to edit source-code. Would be nice if mailbuilder could facilitate this.

Najlepsza odpowiedź
render_value = self.env['mail.render.mixin']._render_template_inline_template(template.body_html, self._name, self.ids)

for fname, value in render_value.items():
self.body_html = value

Its work for me in version 18


Awatar
Odrzuć
Najlepsza odpowiedź

I need to add placeholder in my email body without using any coding part. There is any other method is available? 

I don't want to use the  tag


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
kwi 25
7645
0
mar 25
1290
1
mar 25
30
0
mar 25
1147
3
wrz 24
5326