Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Managament
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Add dynamic url parameter in link or button in email odoo v16

Odoberať

Get notified when there's activity on this post

This question has been flagged
emailurldynamicodoo16features
9 Replies
21755 Zobrazenia
Avatar
LAPA Zero-Pensieri

hi how i can add dynamic data in url of link or button in an email in the marketing campaign automation? 

0
Avatar
Zrušiť
LAPA Zero-Pensieri
Autor

the placeholder {{...}} not work is converted in entities

https://www.lapa.ch/offerta-guanciale?contact_name=%7B%7Bobject.name%7D%7D&phone=%7B%7Bobject.name%7D%7D&email=%7B%7Bobject.email%7D%7D&partner_name=%7B%7Bobject.parent_id.name%7D%7D

LAPA Zero-Pensieri
Autor

i have try to use QWeb Template like

<a t-att-href="'https://www.lapa.ch/offerta-guanciale?contact_name=' + object.name + '&email='+ object.email +'&phone='+ object.phone +'&partner_name='+ object.parner_id.name"></a>

but for some reason the email return error

if i write just "'https://www.lapa.ch/offerta-guanciale?contact_name=' + object.name + '&email='+ object.email" work if i add phone not work... im confused.

@Cybrosys Techno Solutions Pvt.Ltd have some idea?

LAPA Zero-Pensieri
Autor

i think the QWeb Template error is for object.phone is not escaped. how can i escape this value in the html of an email?

LAPA Zero-Pensieri
Autor

for some reason i cant add more than 2 params. 2 parms work if i send manually the email or if i send a test but not work if the campaign start

return QWEB Template error when try to send automatically

Avatar
Bhavin Patel
Best Answer

To add a dynamic URL parameter in a link or button in an email template in Odoo v16, you can use the following steps:

  1. Open the email template that you want to modify.
  2. Select the link or button that you want to add the dynamic URL parameter to.
  3. Click on the "Insert/Edit Link" or "Insert/Edit Button" button in the email editor toolbar.
  4. In the URL field, enter the base URL that you want to use for the link or button, including any static parameters.
  5. Add the dynamic URL parameter to the end of the URL, using the Odoo expression syntax "{{...}}".
  6. Inside the double curly braces, enter the name of the field or variable that you want to use as the dynamic URL parameter.
  7. Save the email template.

Here's an example of how you can add a dynamic URL parameter to a link in an email template:

Let's say you want to include a link to the customer portal for each recipient of your email. You can use the following URL as the base URL for the link:

https://yourdomain\.com/my/customers/portal/

To\ add\ a\ dynamic\ URL\ parameter\ for\ the\ customer\ ID,\ you\ can\ modify\ the\ URL\ like\ this:

https://yourdomain.com/my/customers/portal/?customer_id={{object.partner_id.id}}

In this example, we're using the Odoo expression "{{object.partner_id.id}}" to retrieve the ID of the customer associated with the email recipient. This will dynamically insert the customer ID into the URL for each recipient, so they will be directed to their own customer portal page when they click the link.

Note that the exact syntax and field names may vary depending on your specific use case, so you may need to consult the Odoo documentation or seek further assistance to ensure that your dynamic URL parameter is set up correctly.

2
Avatar
Zrušiť
Emma Dimech

Hi, I am trying to follow these steps for the following:
> link to Quotion (portal view) from follow-up automated email in Marketing Automation App (Lead / Opportunity Model)
> link to Worsheet Report (portal view) from Invoice email template.
> link to Quotation (portal view) from follow-up automated email in Marketing Automation App (Sales Order Model)

I cannot seem to get the syntax right, can you provide any advice?

David Waters

I'd like to do the same but the steps mentioned here don't work. Like other answers in this thread, I also get %7B%7Bobject.partner_id.id%7D%7D as a resulting link whether I use ${ } format or {{ double brackets }} the result is the same. Has something changed in Odoo 17 that doesn't allow for this solution?

Avatar
LAPA Zero-Pensieri
Autor Best Answer

thx, but from marketing automation email i cant go into html of the email. im miss something? 

EDIT i have found the button for go inside the html of email but when the email is send the html {{ is convertend in html entities.. how can i solve this? 


is the result 
contact_name=%7B%7Bobject.name%7D%7D&phone=%7B%7Bobject.name%7D%7D&email=%7B%7Bobject.email%7D%7D&partner_name=%7B%7Bobject.parent_id.name%7D%7D

2
Avatar
Zrušiť
David Waters

I'd like to do the same and I also get %7B%7Bobject.partner_id.id%7D%7D whether I use ${ } format or {{ double brackets }} the result is the same. Has something changed in Odoo 17 that doesn't allow for this solution?

Avatar
Joe-Civ
Best Answer

@LAPA Zero, 

I'm trying to do the same thing, and here's the problem: 

There's two different types of email templates in Odoo

  1. Email marketing - these are used for mass mailings to your customer in the Email Marketing tool
  2. Mail templates - these are used for single emails for server triggered mailing (eg QWeb)

These aren't the same.  

Unfortunately, Email marketing doesn't support Jinja fields, and Mail Templates (like QWeb, don't support Jinja fields.  

Sorry, what your asking for isn't possible, even in today's Odoo online OOTB.  You would have to get a premium account with access to odoo_sh and customize it.  

0
Avatar
Zrušiť
Avatar
Tom Rubino
Best Answer

simply looking for a way to link to current record via the email template. 

This doesn't seem to work either. 

<div style="margin: 16px 0px 16px 0px;" data-oe-version="1.0">

    <a t-att-href="ctx.get('https://XXXXX.odoo.com/odoo/plm/2/action-1087/{{object.id}}')" style="color: #374151; border-style: none; margin: 0px; box-sizing: border-box; border-width: 0px; background-color: #875a7b; padding: 8px 16px; text-decoration: none; border-radius: 5px; font-size: 13px;"><font style="color: #ffffff;">

        Validate my account&nbsp;</font></a>

</div>

Anyone figure out how to create a dynamic link to a record in an email template? I'm in Odoo 18...

0
Avatar
Zrušiť
Avatar
Paulo Matos
Best Answer

Perhaps use a method to retrive the values you want?

In Odoo 18:

<t t-set="desired_value" t-value="object.your_method_retrieve_url()"/>

<a t-att-href='desired_value' t-out="desired_value" />

I solved my problem this way

Thanks

0
Avatar
Zrušiť
Avatar
Tom Jones
Best Answer

How is an issue posted about Odoo v16 stil a problem in v17

Did anyone figure it out?

0
Avatar
Zrušiť
Avatar
David Waters
Best Answer

First time User.. Can't delete this yet. I though I was commenting not answering... My bad.. 

I'd like to do the same and I also get %7B%7Bobject.partner_id.id%7D%7D whether I use ${ } format  or {{ double brackets }} the result is the same. Has something changed in Odoo 17 that doesn't allow for this solution?

0
Avatar
Zrušiť
Avatar
Maduka Sopulu
Best Answer

The way to achieve this is by going to the mail template, 

highlight the word / sentence you want to link, 

Click on the link option, and paste your link with the dynamic field props like  
${object.id}

e.g

/web#id=${object.id}&action=2401&model=approval.request&view_type=form&cids=&menu_id=1160

0
Avatar
Zrušiť
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,

In the email template, in 

<field name="body_html" type="html">

You can give any html content you want for the body of your email.

<div style="margin: 16px 0px 16px 0px;">
<a t-att-href="ctx.get('token_url')"
style="background-color: #875A7B; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px; font-size:13px;">
Validate my account
</a>
</div>

The above mentioned code is the button you see for the email sent when validating account. In the t-att-href, you can give the dynamic value you want.

Regards

0
Avatar
Zrušiť
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrácia
Related Posts Replies Zobrazenia Aktivita
Forwarding emails to a specific Opportunity
email opportunity odoo16features
Avatar
Avatar
1
mar 25
3325
How can the user responsible for the task receive a personalized email?
email task dynamic
Avatar
Avatar
1
dec 24
1735
Odoo Summary Mail - Change from Daily to Weekly Solved
email Summary odoo16features
Avatar
Avatar
Avatar
2
júl 24
2856
v16: generate Lead / Opportunity using emails
email leads odoo16features
Avatar
1
apr 24
2049
configure multiple email domains to send and receive emails
email helpdesk odoo16features
Avatar
0
sep 24
2166
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now