Skip to Content
Menu
This question has been flagged
2 Replies
1122 Views

I am encountering an issue when creating links with dynamic placeholders in email templates. Specifically, when I set up a link in an email template using placeholders, such as www.example.com/contact-from-od?id={{object.id}}, the placeholders are not being correctly replaced in the sent emails.


Example of the issue:


Email Template Setup: Create a link using dynamic placeholders like www.example.com/contact-from-od?id={{object.id}}.

Received Link in Email: https://www.example.com/contact-from-od?id={{object.id}}


According to the Odoo documentation on dynamic placeholders(https://www.odoo.com/documentation/17.0/applications/general/companies/email_template.html#dynamic-placeholders), whilst directly entering “/” allows for selecting dynamic placeholders effectively, this does not seem to apply to links. How can we resolve this issue to ensure that dynamic placeholders are utilized correctly in links?

Avatar
Discard
Author Best Answer

Thank you for your response. After researching, I successfully implemented the desired functionality using t-attf-href.


By the way, this is my first time using the odoo forum and, unfortunately, I am disappointed with some of its features. First, it took nearly 12 hours to receive the activation email after registration. Additionally, the forum does not support pasting code in replies, and having links or images in posts requires higher points. These restrictions forced me to edit out parts of the code just to make a reply, making the entire experience quite frustrating.

Avatar
Discard
Best Answer

i think you could edit html instead of using "/" and add something like this 

 t t-set="url" t-value="'http://example.com/my_page?id=' + str(object.id)"/>

 a t-att-href="url"> Click here

maybe that could help, have a nice day

Avatar
Discard