on 2023 Dec 21 1:19 PM
Hi,
We want dynamic email body in our HTML file for the email notification in SAP BTP Workflow Management. To achieve the same, we are using a context variable ($.context.HTML_Block) which contains HTML block as below.
$.context.HTML_Block = `<br> <strong>ID: </strong> <a target="_blank" href="${context.Url}"
style="-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;text decoration:underline;color:#3d85c6;font-size:14px"> ${context.Id}</a>`;
And the same context variable ($.context.HTML_Block), we are using in HTML file for email body. But this is giving an error during deploy.
Am I missing something here? Or there is any other way to achieve the same?
Thanks in advance!
After years, I finally found out the answer to your question and I shared the solution in this blog:
https://community.sap.com/t5/technology-blogs-by-members/quot-dynamic-quot-email-body-for-email-noti...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you will likely not achieve what you want at all with that approach. See
https://help.sap.com/docs/workflow-capability/workflow-cloud-foundry/configure-mail-tasks
> You can use expressions in the mail body and the subject. However, you cannot add HTML tags in the HTML mail body using expressions, because special characters in the expression results are escaped for security reasons.
This means for example that you cannot dynamically build an HTML table with the rows coming from array data. There might be ways of formatting to achieve a tabular display (e. g. pre-tag or perhaps some CSS mechanism), but you cannot build the mail HTML dynamically, introducing HTML tags through context expressions.
Regards,
Tobias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.