Use HTML Content with UMS Adapters in OSB 12c
In this post, we will learn how to send html content for the emails using a UMS adapter in OSB 12c. There we go:
Pre-requirements
First, we need to verify that we have the UMS adapter and the email driver already working. These configurations are in the previous post Using UMS Adapter to send emails with OSB 12c.
Steps
So first we have to edit the UMS adapter and go to the step 5, Set the option “Message is Opaque (Base64Binary)”
Now, we need to encode the information to Base64 and use use it in the businees service. To accomplish this task we could use a Java callout and use it to encode the information. I have created a Jar file that encode and decode as Base64 and you can download it here.
Extract the jar library and import into the SB Project
.
Create a Java Callout in the pipeline and use the Jar file called decodejarfile.jar as the image bellow.
.
Select the method encode from sysco.binary64.Base64Encoder as the following image.
Create a sample html content in the input.
And set a output parameter, let say htmlEncodedContent
Replace the content body with the request of the UMS business service as the image bellow.
Finally, go to routing and include a transport header. Add the following header field name “jca.ums.part.content-type” and the value ‘text/html; charset=utf-8’ as the image bellow.
This setting will be used to handle html content in the email.
Deploy changes and enjoy sending email with HTML content. Good luck!