cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Cloud Workflow - Dynamic email contents

deepak_gupta35
Explorer
0 Kudos
421

Hi

I want to design email task with email body dynamically determined,

  • I have tried adding script to .html file (assigned to email body) but that does not work, as the html file does not detect the script tags
  • I have also tried using a script task before email task and prepared the html contents in a string and passed that to email body html page, but it takes that string as it is, does not interpret the html tags, for example: <html>, <BR /> etc al tags are as is printed in html.

Is there any way this can be achieved ?

Thanks

Deepak

FRLEN
Participant
0 Kudos

can you share the HTML code that you have used?

View Entire Topic
tobias_breyer
Advisor
Advisor
0 Kudos

Hi Deepak,

most email clients do not execute HTML script tags that are embedded in the mail body, for security reasons, so anything involving JavaScript will typically only work in very specific environments.

Similarly, the mail task escapes HTML tags for security reasons, when they are inserted dynamically via JUEL expressions.

If you have array-like data, this usually means that you can display data only in a "low-fidelity" way, e. g. using the "pre" HTML tag that surrounds an expression that contains the data formatted with tabs and newlines. For simple data (non-array), you should be able to use CSS styling to achieve lots of formatting options on the static HTML containing respective JUEL expressions.

So I guess you can only make it really dynamic if you link to a UI that opens in the browser. The UI would typically make use of Workflow Service APIs or call to your own services for the necessary data.

See also https://stackoverflow.com/questions/3054315/is-javascript-supported-in-an-email-message

Best regards,

Tobias