Friday, September 30, 2016

Send multiple attachments in one mail streamserve

Background

I have a MOM report (PPS601) in which I generate PO data as a CSV apart from the standard PDF layout. So in order to do that I use StreamOut process type in Stream Server.

clip_image001_thumb[1][1]

Since my client wants output as a MAIL I used default mail connector to send the PDF layout and created a new connector copying the default mail connector to send CSV with TXT driver since PDF driver not support the CSV files.

clip_image003_thumb[2]

Problem

But the problem is that CSV and PDF are sent in a two separate mails as single attachments. But my requirement is to have two files in one mail thread as two attachments.

clip_image004_thumb[1]

Solution

Solution is to use attachment connector to send CSV file and attach attachment connector to the mail connector .

Step 1:

Create Attachment connector:

clip_image006_thumb[1]

clip_image008_thumb[1]

For attachment connector no need to specify the driver settings. In order to see the setting panel in attachment connector need to the switch to the generic platform view. In physical platform level attachment connector settings can’t be seen.

Step 2:

Go to the Mail Connector settings relevant runtime and click edit mail

clip_image009_thumb[1]

Step 3

In Edit Mail window click the attachment Icon.

clip_image011_thumb[1]

Then below window will appeared.

clip_image012_thumb[1]

Step 4:

In that popup change the attachment type to “Output from attachment connector” and give the attachment name for attachment connector. (Attachment connector which was created in platform previously).

Give attachment name(name for the CSV attachment )  to the “Attachment name” text box (even possible to use a variable)

clip_image013_thumb[1]

Step 5:

Now make CSV process delivery media as the attachment connector that was created previously. To change the delivery media dynamically I used below code snipped in before process event. There is a nice article with detail explanation about changing delivery media in the StreamShare forum by Andreas Hjelle. Please read it.

http://streamshare.streamserve.com/Articles/Article/?articleId=325

$que = "ATTA";
callproc("CSVO");

Now all good , export the project.

Output

clip_image015_thumb[1]

You can see two attachment were attached in to one email.

Useful links

· http://streamshare.streamserve.com/Forum/Topic/?topicID=9731

· http://streamshare.streamserve.com/Forum/Topic/?topicID=7482

· http://streamshare.streamserve.com/Articles/Article/?articleId=325

No comments:

Post a Comment