Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
3 Replies
10551 Tampilan

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.

Avatar
Buang
Penulis Jawaban Terbai


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.


Avatar
Buang

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.

Jawaban Terbai
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


Avatar
Buang
Jawaban Terbai

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


Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
1
Apr 25
7696
0
Mar 25
1299
1
Mar 25
30
0
Mar 25
1153
3
Sep 24
5521