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 -
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!!.
This use case has 2 bpel processes -
- A reusable email process (hereafter REP) that sends the email using "Email" activity.
- 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!!.