Skip to main content
udayasain741
January 30, 2023
Question

Convert Html code in expression rule

  • January 30, 2023
  • 8 replies
  • 0 views

Hi Team,

I am trying to convert html code in my email template to dynamic so i can loop some values using expression rule but i facing some issue in syntax , Looking for the help

below is the html code

<!DOCTYPE html>
<html>
<body>
<head>
<link rel="stylesheet" href="styles.css">
</head>

<h2>###bodytext###</h2>

<br>
<br>
<h2>Please click on any below link to submit you response</h2>

<a href="mailto:processmodeluuid0002e98e-199e-8000-273d-7f0000014e7a@cscswdev.appiancloud.com?subject=###resultId###&body=Please don't edit subject and To-email Address, Please add your comments below">Complete</a>
<br></br>
<a href="mailto:processmodeluuid0002e98e-199e-8000-273d-7f0000014e7a@cscswdev.appiancloud.com?subject=###resultId###&body=Please don't edit subject and To-email Address, Please add your comments below">Cancel</a>

<br>
<br>
<a href="mailto:processmodeluuid0002e98e-199e-8000-273d-7f0000014e7a@cscswdev.appiancloud.com?subject=###resultId###&body=Please don't edit subject and To-email Address, Please add your comments below">Comments</a>


</body>
</html>

    8 replies

    stefanhelzle0001
    January 30, 2023

    Seems like you want to send this by email. The "Send Email" smart service can read your template and allows you to replace the placeholders. Did you try that?

    udayasain741
    January 30, 2023

    yes stefan, thats works fine but would like to create href links dynamically to pass value from array below is new code i tried

    "
    <html>
    <body>
    <head>
    <link rel="stylesheet" href="styles.css">
    </head>

    <h2>###bodytext###</h2>

    <br>
    <br>
    <h2>Please click on any below link to submit you response</h2> "

    &

    a!forEach(
    items:ri!methods,

    expression :

    <a href="mailto:processmodeluuid0002e98e-199e-8000-273d-7f0000014e7a@cscswdev.appiancloud.com?subject=###resultId###&body=Please don't edit subject and To-email Address, Please add your comments below">fv!item</a>
    )
    &

    </body>
    </html>"

    stefanhelzle0001
    January 30, 2023

    So you want to replace "###resultId###" with some dynamic value? Did you try the substitute() function?