I am working on an integration with Odoo, that makes use of a JavaScript applet on the website to read the attributes of an HTML element and use them to identify the logged in customer.
Unfortunately, I am a noob at front-end development and cannot get it to work.
An element like this does output the email address, for instance me@example.com, of the user onto the web page:
<div t-raw="request and request.env.user.partner_id.email"/>
How can I assign the value of request.env.user.partner_id.email to the data-email attribute, instead of the hard-coded email address, kin the identification element here below??
<div
id="customer-identification-html-element"
data-authenticated="true"
data-email="me@example.com"
>
</div>
I tried setting data-email="request.env.user.partner_id.email", but then the string is sent as is to the third party, without resolving its value.
I also tried t-att-data-email="request.env.user.paretner_id.email", to get an error while rendering the template.