Thursday, July 8, 2021

OIC - dynamic email send with html table content.

Here, i will explain the steps how we can send the dynamic email with html table content.

Steps:

Step1: create an app driven integration and drag and drop a rest trigger connection and configure the request json as below:

{

"EmployeeDetails":{

"Employee": [{

"Name": "asd",

"Id": "as123"

}]

}

}

Step2: take an assign and create a variable like emailContent with

"<table><tr><th>Name</th><th>Id</th></tr>"

Step3: take a for each action and map with fkr each employee

Repeating element: /nssrccmpr:execute/nsmpr3:request-wrapper/nsmpr3:EmployeeDetails/nsmpr3:Employee

Step4: in the for each action, in the emailContent variable add the follow:

concat($emailContent, "<tr><td>", Name_xpath,"</td><td>",Id_xpath,"</td></tr>")

Step5: outside of the loop, take assign and add the close table tag in the emailContent variable.

Concat($emailContent, "</table>">

Step6: take notification action and provide details for From, To and Subject. And then create a paramter as body and assign the variable $emailContent. And write the beloe code in the Body section.

<html>

<head>

You can place any style script here

</head>

<body>

<p>Below are the emp details:</p>

{body}

</body>

</html>

Step7: add the tracking, save and activate and test it.



No comments:

Post a Comment

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...