Thursday, June 28, 2012

BPM 11g HTML Email Notification

As on the date of writing this entry, the latest BPM release is 11.1.1.6 (also called the PS5). If you have ever wondered or had issues in sending 'HTML' email notifications from BPM 11g using the 'Notification' activity, here is a workaround to get the HTML email notifications working.

In your BPM process drag and drop the 'Notification' activity from the activity pane and configure the settings. This will create a 'BPM-Notification Service' web service adapter with a set of operations (for different communication channels) under the 'External References' swim lane of the Composite editor. If you closely notice, there is no way to explicitly specify the 'Content Type' using the default 'Notification' activity and hence all emails are by default are 'text/plain' types.

To overcome this issue, drag and drop a service task and refer to the 'BPM-Notification Service' web service and under 'Data Associations' expand the 'Content' section of the notification service and map the 'ContentType' element to 'text/html' along with other configuration details such as 'fromAccount', 'to' etc..

Essentially what we are trying to achieve here is that to explicitly specify the email 'contentType' by leveraging the service task 'Data Association' capability.

Now, all your message content with HTML tags for formatting such as <BR> will take effect and the email messages would be HTML formatted.

8 comments:

  1. How can I use this to send an attachment also? It does not seem to have argument for attaching file..

    ReplyDelete
    Replies
    1. I don't think it is possible with this approach. But on the flip side if there are attachments then the default notification activity may prove useful enough which provides option to attach files and the emails I hope are automatically HTML formatted. Let me know how it goes.

      Delete
  2. One of the biggest obstacles to HTML-based email performance was broken, missing or blocked images caused by email programs that did not support images (or had their imaging support turned off manually by the user) followed by email programs such as Windows Mail or Outlook and services such as Google's Gmail that automatically blocks images.

    HTML email software

    ReplyDelete
  3. Email not sent. Is there anything else other than contentType,contentBody,to which needs to be mapped

    ReplyDelete
    Replies
    1. Can you send an email successfully from your process otherwise? This post just addresses enabling HTML email notifications.

      You can first try to test your email notification from EM console under the UMS module.

      Delete
  4. Hi Sathya, the email is still sent as "text/plain" even if I set mimeType attribute in contet to "text/html"

    ReplyDelete
  5. Hi Sathya, Email Notification tab in the header name:html value: meta http-equiv=content-type content=text/html; charset=UTF-8 But as I did not work. Can you help?

    ReplyDelete