Email Template cannot show HTML stored as String variable

Tagged:
  • Vasileios Thanasias
    Participant
      Has successfully completed the online course Basics (100)
    2 years, 4 months ago #36627

    Hello,

    I have the following email template, where the orderSummaryHTMLAsString is a variable passed from BO and contains an HTML snippet as String.

    ————————————————————

    Sie erreichen uns telefonisch unter unserer Service Hotline:0800 8888 888 oder per E-Mail unter: service@aaa.de

    <p>

    {{orderSummaryHTMLAsString}}

    </p>

    ————————————————————

    I want to show the HTML rendered from the variable above.

    But in the email I get this

    email-content

     

    Is there any way to render a HTML string generated from a BO, to the email template?

    Jennifer Häfner
    Moderator
      Has successfully completed the online course Intermediate (200)
      Has successfully completed the online course Advanced (300)
      Has successfully completed the online course Basics (100)
      Has successfully completed the online course Advanced (310)
      Has successfully completed the online course Advanced (320)
      Has successfully completed the Intermediate Certification
      Has successfully completed the Advanced Certification
    2 years, 4 months ago #36693
    Up
    0
    Down
    ::

    Hi Vasileios,

    The problem here is that the HTML tags in the template input are automatically escaped when generating the template. I think it can also be a security issue when HTML is given as input.

     

    So, I suggest two options for a workaround:

    1. Configure the HTML in the template and only set the text values as input –> the HTML can be shown in the mail text
    2. Convert the order summary HTML to a PDF using PDF templates (see https://community.simplifier.io/knowledge/create-a-pdf-template-via-plugin/) and use the Base64 data as mail attachment. Send the mail with attachment via the Server-Side BO Email API (see https://community.simplifier.io/doc/current-release/applications/business-objects/create-business-objects/business-object-api/#1595936660592-f4a3a811-c99f)
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.