Tuesday, November 20, 2012

Sending HTML Email With Embedded XML Content

Today I am checking out on how to send an html formatted email from a bpel process. Sharing my findings on this topic here -

This use case has 2 bpel processes -

  1. A reusable email process (hereafter REP) that sends the email using "Email" activity.
  2. A bpel process to prepare html of email and invoke the reusable email service.

I prepared an email format that will have few tables and xml message inside the table. For this I have used XSLT to build html from the bpel xml messages and assigned that html to email body of notification service. But this is not that straightforward as the email received was not properly formatted. The xml tags were all disappeared and only data values separated were shown.

Its because the bpel engine treated those xml tags as bpel variables. To avoid this first prepare the html and assign it to the input of REP.


Now inside the REP expand the email activity, open the assign and use toCDATA xsl function to populate ContentBody variable of email activity as shown in this image.


Now the email was well formatted and xml content rendered perfectly!!.

No comments:

Post a Comment

Demystifying OIC, OCI and Oracle SOA CS

What is OIC (Oracle integration cloud), OCI (Oracle cloud infrastructure), and SOA cloud service and how they are different? - This has bee...