ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » [Solved] Does EmailOutput node supports HTML msg ?

Post new topic  Reply to topic
 [Solved] Does EmailOutput node supports HTML msg ? « View previous topic :: View next topic » 
Author Message
cool_dev
PostPosted: Tue Jul 08, 2008 7:10 am    Post subject: [Solved] Does EmailOutput node supports HTML msg ? Reply with quote

Newbie

Joined: 08 May 2008
Posts: 6

Hi,

anybody knows if there is a way to send off msg with the EmailOutput node but providing the full html (including DTD, head and body tags) and NOT just the body content ?

To be more precise, WMB 6.1 is used and the flow looks like this: MQInput -> Compute -> EmailOutput

Code:

SET OutputRoot.EmailOutputHeader.Subject = 'Test html email';
SET OutputRoot.EmailOutputHeader.To = test@test.com;
SET OutputRoot.EmailOutputHeader.From = me@me.com;
SET OutputLocalEnvironment.Destination.Email.BodyContentType = 'text/html';

Now the email message is provided thanks to a templating engine, so I simply get it and set the email msg with it:
Code:

DECLARE emailMsg CHARACTER;
SET emailMsg = CAST(InputRoot.BLOB.BLOB AS CHARACTER CCSID 1208);
SET OutputRoot.XML = emailMsg;
-- Don't work either
-- SET OutputRoot.XMLNSC = emailMsg;
-- SET OutputRoot.XMLNSC.Message = emailMsg;

The result from the above is an email body with unwanted tags Email and Body that screw up the msg display in the email reader
Code:

<Email><Body>  &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;
&quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
&lt;html&gt; <!-- Actual email content -->
&lt;/html&gt;
</Body></Email>


Any idea on how to get rid of the Body and Email tags to display the provided code as is ?


Last edited by cool_dev on Thu Jul 10, 2008 2:11 pm; edited 1 time in total
Back to top
View user's profile Send private message
kirankinnu
PostPosted: Tue Jul 08, 2008 7:45 am    Post subject: Reply with quote

Centurion

Joined: 12 Jun 2004
Posts: 128
Location: Chicago, IL

You Have to build the message in this fashion:

SET OutputRoot.XMLNSC.Message.Body[1] = 'Test 123';
SET OutputRoot.XMLNSC.Message.Body[1].br = '';
SET OutputRoot.XMLNSC.Message.Body[2] = 'Thank you,';
SET OutputRoot.XMLNSC.Message.Body[2].br = '';
SET OutputRoot.XMLNSC.Message.Body[3] = '--------------';

Build all the HTML tags in XML tree format..
Back to top
View user's profile Send private message
cool_dev
PostPosted: Tue Jul 08, 2008 8:00 am    Post subject: Reply with quote

Newbie

Joined: 08 May 2008
Posts: 6

Thank's for the reply kirankinnu,

well, I am trying to avoid to generate all the content (including tags) directly from WMB. The reason is that the email content is built with a third party sw running on WAS, resulting in an html page. This page is then sent to WMB prior to be sent out to SMTP server.

Now it would be much helpful to be able to sent out this html page as is, in the email msg...
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Jul 08, 2008 9:08 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

I hae created several flows that send HTML formated messages with the EmailOutputNode.

The ESQL builds the HTML page as a character string. So in theory if you can get at the data you get from WAS as a character string then you should be able to achieve what you want.
The HTML I format includes <h1>, <H2>, <B>, <BR> & <P> tags.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
cool_dev
PostPosted: Thu Jul 10, 2008 2:10 pm    Post subject: Reply with quote

Newbie

Joined: 08 May 2008
Posts: 6

The issue was fixed using a JavaCompute node where a BLOB parser element is created, then the actual BLOB is added as the last child.
Code:

outParser.createElementAsLastChild(MbElement.TYPE_NAME_VALUE, "BLOB", html.toString().getBytes());
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Jul 10, 2008 10:42 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

You really don't have to use a Java Compute node to achieve this.
In none of the flows I have written that send HTML formated email, use a JCN.
Actually, in the 7 years I have been using Message Broker, I have never had to use a JCN (ok they were not available with V2.0.x etc). ESQL has always been able to meet the requirements.
Its not that I don't know Java. I am currently working with Lotus Expeditor Client.


Still, its good to know that you have managed to get it working
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » [Solved] Does EmailOutput node supports HTML msg ?
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.