In my previous post (Part-1) I explained how to send email from OSB. But in that case we can send email only to one address and it does not have Email subject populated. In this post I will explain how to send email to different users with different contents and subject.

In this post we will create one proxy service which sets the email address, email subject and email content dynamically and in message flow of proxy we will use "Transport Header" activity to set all these values dynamically. We also need one schema that we will use in proxy service.

1.) Start by creating a simple schema, you can create this schema in Jdeveloper.

In Message Type Configuration choose XML as "Request Message Type" as we are using schema to create proxy service. Then click on Browse button and select the schema that we added above.

Select request element "Email" of the browse schema.

Now accept default values and create proxy service.

3.) Now we have business and proxy service ready. We need to pass Email subject, Email content and Email to address dynamically to business service. Navigate to Message flow of proxy service.

We link proxy service to business service by using route node.

Right click on EmailBuinessService and choose Edit Route. Add an action in Route node to invoke business service. Select Business Service in Route to option.

Add Transport Header activity. By Default it shows only one header but we can add headers as per our requirement. In our case we need only two headers one for Email To and other for Email subject. For Email content we will use Replace activity.Choose email->To from drop down and in action assign value from request message ($body/dyn:Email/dyn:Emailto/text())

0
comments
:

Post a Comment

About Me

Disclaimer

This blog is solely owned by me and it does not represent any company or customer work. This blog is result of the POC's which I keep on doing during my spare time. Please feel free to reach out to me in case you have any concern regarding material in this blog.