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 » Dynamically reading files and emailing them as attachments

Post new topic  Reply to topic
 Dynamically reading files and emailing them as attachments « View previous topic :: View next topic » 
Author Message
rpemmaraju
PostPosted: Thu Aug 04, 2011 8:15 am    Post subject: Dynamically reading files and emailing them as attachments Reply with quote

Newbie

Joined: 10 Oct 2006
Posts: 9
Location: Detroit, Michigan, U.S.A

Hello,

I'm working on a scenario where-in i have to dynamically read the Email To,From,Subject,Body, number of attachments, name of attachments from the XML, go to the shared folder, and email them.

Here is my flow :

MQInput --> Compute --> FileRead --> Compute1 --> EmailOutput

I'm able to dynamically send emails with single attachment.
If there are 3 Attachment Names in the XML, i'm able to dynamically read the 3 files, BUT, sending 3 emails.

Environment : WMB 7.0.0.2 on Windows

Any advice will be highly appreciated.

thank you,
RP
Back to top
View user's profile Send private message Yahoo Messenger
Vitor
PostPosted: Thu Aug 04, 2011 8:30 am    Post subject: Re: Dynamically reading files and emailing them as attachmen Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

rpemmaraju wrote:
Any advice will be highly appreciated.


Build the 3 emails you need to send one at a time. Send them to the EMailOutput node.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
dilse
PostPosted: Thu Aug 04, 2011 8:42 am    Post subject: Reply with quote

Master

Joined: 24 Jun 2004
Posts: 270

From his statement I am getting a feeling that he wants to send only one email with three attachment instead of three separate emails.

OP, clarify what you want to achieve.
Back to top
View user's profile Send private message
rpemmaraju
PostPosted: Thu Aug 04, 2011 8:46 am    Post subject: Re: Dynamically reading files and emailing them as attachmen Reply with quote

Newbie

Joined: 10 Oct 2006
Posts: 9
Location: Detroit, Michigan, U.S.A

Vitor wrote:

Build the 3 emails you need to send one at a time. Send them to the EMailOutput node.


Vitor,

thank you for your quick response.

I need to send, in the example scenario, the 3 files as 3 attachments in one email to a list of receipients.

thank you,
RP.
Back to top
View user's profile Send private message Yahoo Messenger
Vitor
PostPosted: Thu Aug 04, 2011 8:47 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

dilse wrote:
From his statement I am getting a feeling that he wants to send only one email with three attachment instead of three separate emails.


Yes, that is a valid interpretation of the post isn't it?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
rpemmaraju
PostPosted: Thu Aug 04, 2011 8:49 am    Post subject: Reply with quote

Newbie

Joined: 10 Oct 2006
Posts: 9
Location: Detroit, Michigan, U.S.A

dilse wrote:
From his statement I am getting a feeling that he wants to send only one email with three attachment instead of three separate emails.


dilse,

Yes. That is the requirement.

Thank you,
RP.
Back to top
View user's profile Send private message Yahoo Messenger
mqjeff
PostPosted: Thu Aug 04, 2011 8:53 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You could use collector.

You could use Propagate and a LocalEnvironment override to tell FileRead where to put the data it reads (it *does* support that, doesn't it?) so that it puts it in a different place in the message tree each time it reads it.

A few other options, probably, to assemble the contents of the three files into the same logical message tree.
Back to top
View user's profile Send private message
rpemmaraju
PostPosted: Thu Aug 04, 2011 9:23 am    Post subject: Reply with quote

Newbie

Joined: 10 Oct 2006
Posts: 9
Location: Detroit, Michigan, U.S.A

mqjeff wrote:
You could use collector.
You could use Propagate and a LocalEnvironment override to tell FileRead where to put the data it reads (it *does* support that, doesn't it?) so that it puts it in a different place in the message tree each time it reads it.

A few other options, probably, to assemble the contents of the three files into the same logical message tree.


Thank you mqjeff for your suggestions.
I have been trying to see if the following works:

MQInput --> Compute (out terminal) --> FileRead --> Compute2
Compute (out1 terminal) --> Compute1 --> EmailOutput

I'm looping through and trying to save the 3 Attachments in Environment in Compute2, retrieve them in Compute1 and Email.

For some reason, im getting email with just one attachment which cannot be opened.

I will keep working on it and keep you posted and/or come post a request for advice.

thank you,
RP.
Back to top
View user's profile Send private message Yahoo Messenger
WGerstma
PostPosted: Thu Aug 04, 2011 10:22 am    Post subject: Reply with quote

Acolyte

Joined: 18 Jul 2011
Posts: 55

You could also use the FlowOrder Node.

To its first Terminal you put a Compute which propagates n times to a FileRead and than use a compute to put the read files to environment.

In the second Terminal, you use a compute to move the files from environment to the message tree and pass it to the Mail Node.
Back to top
View user's profile Send private message
rpemmaraju
PostPosted: Thu Aug 04, 2011 10:55 am    Post subject: Reply with quote

Newbie

Joined: 10 Oct 2006
Posts: 9
Location: Detroit, Michigan, U.S.A

WGerstma wrote:
You could also use the FlowOrder Node.


MQInput --> Compute (out terminal) --> FileRead --> Compute2
Compute (out1 terminal) --> Compute1 --> EmailOutput


Iam accomplishing the same using Compute node and propagating to 'out' terminal for reading the file(s) using FileRead node and storing them in Environment.Vars.Files[] in Compute2;
Compute node will propagate to Compute1 using 'out1' terminal after reading all the files;

Now, in Compute1,
iam populating OutputLocalEnvironment.Destination.File.Name based on number of files and iam setting the following properties(leaving couple of properties to default values) on the EMail output node:

Attachment Content : $Root

Attachment Content Type :text/html
Attachment Content Encoding : base64:Encoding for binary data
Multipart Content Type : All MIME body parts should only be considered in the aggregate

thank you,
RP
Back to top
View user's profile Send private message Yahoo Messenger
rpemmaraju
PostPosted: Thu Aug 04, 2011 1:42 pm    Post subject: Reply with quote

Newbie

Joined: 10 Oct 2006
Posts: 9
Location: Detroit, Michigan, U.S.A

mqjeff wrote:

You could use Propagate and a LocalEnvironment override to tell FileRead where to put the data it reads (it *does* support that, doesn't it?) so that it puts it in a different place in the message tree each time it reads it.


Hello mqjeff,

I have 3 files in LocalEnvironment.Vars.Files[].

Now, how do i attach 3 files ? Could not find any relevant info with regards to sending multiple attachments in InfoCenter:

[url] http://127.0.0.1:58984/help/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fac66340_.htm [/url]


Any suggestions ?
Back to top
View user's profile Send private message Yahoo Messenger
marko.pitkanen
PostPosted: Thu Aug 04, 2011 9:48 pm    Post subject: Reply with quote

Chevalier

Joined: 23 Jul 2008
Posts: 440
Location: Jamsa, Finland

Hi,

I think you should try to create following structure for all your attachments to the OutputLocalEnvironment before forwarding message to EmailOutput -node.

Sorry the pseudo code (not tested).


Code:

CREATE FIELD OutputLocalEnvironment.Destination.Email AS rEmail;
--for all your attachments
CREATE LASTCHILD OF rEmail AS rAttachment NAME 'Attachment';
rAttachment.ContentName = 'Filename';
rAttachment.ContentType = 'text/xml';
rAttachment.Content = getAttachmentAsBLOB();


--
Marko
Back to top
View user's profile Send private message Visit poster's website
rpemmaraju
PostPosted: Fri Aug 05, 2011 8:53 am    Post subject: Reply with quote

Newbie

Joined: 10 Oct 2006
Posts: 9
Location: Detroit, Michigan, U.S.A

marko.pitkanen wrote:

I think you should try to create following structure for all your attachments to the OutputLocalEnvironment before forwarding message to EmailOutput -node.


Thank you Marko. It worked !

Regards,
RP.
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Dynamically reading files and emailing them as attachments
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.