The Odoo Email Template uses email_from in the email template. in that I saw some kind of example like
${(object.email or '')|safe}
here is a screenshot
that I am confused with |safe , I wanted to know the use of '| safe '.
|safe
The structure will automatically remove the HTML. But when you need to prevent the escaping of an HTML template, you can use a "safe" filter. Using a safe filter for variables in which users have control can result in an XSS (JS injection) vulnerability.
Well Safe - these are mainly filters, filters are separated from the variable by the pipe symbol (|). Thus, the output of ${(object.email or '')|safe} will be generated as ${safe(object.email or '')} .
${safe(object.email or '')}
Safe is used to prevent escaping the HTML content template. The safe filter explicitly marks the string as "safe", so it should not be automatically escaped, even if auto-escaping by ODOO structure is enabled.
For more information, visit:
http://jinja.pocoo.org/docs/dev/templates/#working-with-manual-escaping http://jinja.pocoo.org/docs/dev/templates/#working-with-automatic-escaping
Source: https://habr.com/ru/post/1246088/More articles:Windows packet forwarding - network-programmingVertical TextView with Ellipsize and all other default TextView features - androidDeploying an Fb application on Heroku - gitThe fastest way to unpack bit (sub-byte) numbers from a file - pythonHow to hide the VS Code view pane - user-interfaceHow to upload a file from FTP and save it locally using Cordova? - androidAndroid emulator does not install the application when using the "ionic emulate android" command - androidHow to transfer ftp file to server from PhoneGap / webapp? - javascriptGetting gcd list - haskellRotate PDF to UIWebView with Swift - iosAll Articles