Rendering Dynamic HTML  content in Email Template 
213
Views
4
Comments
New
OutSystems UI

Currently in OutSystems Reactive, there is no native, straightforward way to render dynamic HTML content inside an Email Template.

  • Expressions Escape Everything: The standard Expression widget in the Email editor automatically escapes all HTML tags, converting them to plain text.

  • Missing Property: Unlike standard Reactive Web screens, the "Escape Content = No" property is missing from Expressions in the Email editor.

  • No JavaScript Support: Emails are rendered server-side, so common web workarounds like using a JavaScript OnReady action to set innerHTML do not work in an email context.

  • Container Limitations: Using a Container with an innerHTML attribute often results in empty content because the platform's internal email engine (similar to an internal GetEmailHtml method) frequently strips these attributes during generation for security reasons.


OutSystems should implement one of the following to improve the developer experience:

  1. Enable "Escape Content = No": Add the same property found in standard web expressions to the Email Expression widget, allowing developers to pass sanitized HTML directly.

  2. Native HTML Widget for Emails: Enable the "HTML Element" widget within the Email UI Flow toolbox so developers can explicitly define HTML tags and inject attributes safely.

  3. Sanitized HTML Input: Provide a dedicated widget or property that specifically accepts the output of the SanitizeHtml action and renders it as formatted HTML in the final email body.


Thanks,
Ananth



Changed the category to
OutSystems UI

There is an astonishingly simple way around this issue.

Create a Traditional Web App, with just:
An email with two parameters (HTML and Subject)
A public action with five parameters (HTML, Subject, to, CC and BCC) that sends the email.

Chuck an expression in the email and set its Escape Content = No and it's value to the HTML parameter, and set the Subject to the Subject parameter.

Hi Nathan,

Thanks for your suggestion — I tried the same approach and it works perfectly.

However, the main objective here is to implement this functionality within a Reactive Web App itself, without creating a separate Traditional Web App. I’m specifically looking for a way to achieve this directly in Reactive.


Thanks

I suspect they've removed the "Escape=False" option when they built the Reactive platform specifically to make you setup each email separately, using an extra AO for each email.