Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2765 Lượt xem

hi there

does anybody knows how to add a dynamic value (url) to a button in such a way that its rendered in outlook ?

a href button is rendered perfectly, but when i uses t-att-href to attach the dynamic link to the button then is does not get rendered in outlook. a lot of our clients are using outlook. 


Dennis

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello @dennis Celen

Hope you are doing well,


This could be because of improper concatenation of URL string and dynamic value. 
Please use t-attf-href as it makes it easier to concatenate static value with dynamic value

Please see below example, Here to add dynamic value keep it enclosed in #{} and it will be evaluated and concatenated.

Please Find code in comment. 


Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Ảnh đại diện
Huỷ bỏ

Code :-

<t t-foreach="[365,366,367]" t-as="id">
<a t-attf-href="https://www.microsoft.com/en-in/microsoft-#{id}">Outlook Link</a>
</t>

and if the whole url comes from a variable:

<t t-foreach="urls" t-as="url">
<a t-attf-href="#{url}">Outlook Link</a>
</t>

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 2 23
1600
1
thg 5 22
2548
0
thg 5 21
2445
2
thg 5 15
7394
2
thg 1 25
1073