IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.

 View Only
Expand all | Collapse all

WTX email adapter for sending attachments

Archive User

Archive UserTue May 21, 2019 06:00 AM

Archive User

Archive UserThu May 23, 2019 04:28 AM

  • 1.  WTX email adapter for sending attachments

    Posted Tue May 21, 2019 06:00 AM

    Originally posted by: RT123


    Hi All,

     

    Can you please help me with a sample map which uses the ITX/WTX email adapter to send email with multiple files as an attachment. I am using ITX v 9.0.0.3

    What is best approach? And also how to send the attachment, as single files attached or a one zip file?

    Note: The number of attachments are not fixed, we can have any number of attachments.

     

     

    Thanks,

     


    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 2.  Re: WTX email adapter for sending attachments

    Posted Thu May 23, 2019 03:48 AM
      |   view attached

    Originally posted by: PaulBrett


    Assuming you have all the attachments in a single directory (with no other files) you could use the Batch adapter to get a list of the files.

    Using this list you could design a map that would create a single ZIP file, containing those files.

    Finally, you could read this attachment in, convert to BASE64, and attach it as part of a MIME encoded message to be sent using SMTP to an email relay server.

    See the attached example for these three steps.

    Thank you.

    Paul

    Follow me on Twitter


    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange

    Attachment(s)

    zip
    ZipAndEmail.zip   7 KB 1 version


  • 3.  Re: WTX email adapter for sending attachments

    Posted Thu May 23, 2019 04:28 AM

    Originally posted by: RT123


    Hi Paul,

     

    Thank you for the map file. But while I run the EmailAtt map i get the error source not available, the Archive.zip file isn't generated while I run the ZipFiles map though it completes successfully. Can you please check what configuration I could have missed.

     

    Thanks


    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 4.  Re: WTX email adapter for sending attachments

    Posted Thu May 23, 2019 04:38 AM

    Originally posted by: PaulBrett


    You have to run the maps in order:

    GetList.mmc
    ZipFiles.mmc
    EmailAtt.mmc

    ....so that the Archive.zip exists before the final map attempts to email it.

    Thank you.

    Paul

    Follow me on Twitter


    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 5.  Re: WTX email adapter for sending attachments

    Posted Thu May 23, 2019 04:42 AM

    Originally posted by: RT123


    Yes Paul, I run the maps the below order:

    GetList.mmc

    ZipFiles.mmc 

    EmailAtt.mmc.

     

    ZipFiles.mmc doesnt generate the Archive.zip file after running. Thats why the last map fails with source not available. Please check.

    Can you check at your end too. Thanks.


    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 6.  Re: WTX email adapter for sending attachments

    Posted Thu May 23, 2019 04:46 AM
      |   view attached

    Originally posted by: RT123


    I am also attaching the ListOfFiles.txt file generated after my first map: GetList.mmc is run. Kindly check.


    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender

    Attachment(s)

    txt
    ListOfFiles.txt   221 B 1 version


  • 7.  Re: WTX email adapter for sending attachments

    Posted Thu May 23, 2019 04:47 AM

    Originally posted by: PaulBrett


    There's a small mistake in the EmailAtt.mmc map.  Change rule from:

    ="ITX E-Mail Adapter 1.0.0.0.0.0.0"

    to

    ="IBM Transformation Extender Email Adapter 1.0.0.0.0.0.0"

    ....although I would like to point out that this map will never actually run, until you amend some of the details, such as changing it to point to your own SMTP server.

    Thank you.

    Paul

    Follow me on Twitter


    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 8.  Re: WTX email adapter for sending attachments

    Posted Thu May 23, 2019 04:52 AM

    Originally posted by: RT123


    Yes have changed the rule as you have corrected it, but the issue here is Archive.zip file itself isn't created. Is  there some setting or configuration to be done for the zip file to be created. Also i am pointing my SMTP server to mine.

     

    Thanks,

     

     

     


    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 9.  Re: WTX email adapter for sending attachments

    Posted Thu May 23, 2019 05:11 AM

    Originally posted by: PaulBrett


    What is the output of the GetList map?

    Change rule :

    =PUT("ZIP","FILE,Archive,"+PACKAGE(In1),"dummy")

    to

    =PUT("ZIP","FILE,Archive,"+PACKAGE(In1),"dummy") + LASTERRORMSG()       (and change the target of the output card from SINK to FILE)

    ...to get more information about what could be going wrong with ZIP file creation.

    Thank you.

    Paul

    Follow me on Twitter


    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 10.  Re: WTX email adapter for sending attachments

    Posted Thu May 23, 2019 05:17 AM

    Originally posted by: PaulBrett


    Change rule:

    =PUT("ZIP","FILE,Archive,"+PACKAGE(In1),"dummy")+LASTERRORMSG()

    to

    =PUT("ZIP","FILE,"+GETDIRECTORY()+"Archive,"+PACKAGE(In1),"dummy")+LASTERRORMSG()

    ....to avoid problems with running the map in Map Designer.     (Archive.zip was being created in product installation directory)

    Thank you.

    Paul

    Follow me on Twitter


    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 11.  Re: WTX email adapter for sending attachments

    Posted Thu May 23, 2019 05:40 AM

    Originally posted by: RT123


    Thank you Paul. This time it creates the Archive file without .zip extension. I am attaching the Archive generated form the the map putput of ZipFiles.mmc.  Again since the .zip extension sin't there the final map fails with source not available error.


    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 12.  Re: WTX email adapter for sending attachments

    Posted Thu May 23, 2019 06:00 AM

    Originally posted by: RT123


    Now it works, now i changed the command to =PUT("ZIP","FILE,"+GETDIRECTORY()+"Archive.zip ,"+PACKAGE(In1),"dummy")+LASTERRORMSG() and it works.

     

    Another query, i have is now I wish to read form another folder in my windows desktop folder, how should be modified something like below will work?

     

    @echo off
    cd /d %~dp0
    dir /b C:/Users/RT123/Desktop/SamplePics


    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 13.  Re: WTX email adapter for sending attachments

    Posted Thu May 23, 2019 06:07 AM


  • 14.  Re: WTX email adapter for sending attachments

    Posted Thu May 23, 2019 06:41 AM

    Originally posted by: RT123


    Hi Paul,

     

    Seems my issues aren't resolving. In your example the files are already placed within the /tmp folder which is within the ITX workspace. I want to read the files from another directory C:/Users/RT123/Desktop/SamplePics.

    @echo off
    cd /d %~dp0
    dir /b C:/Users/RT123/Desktop/SamplePics

    The command above reads the file names but not its content and also cannot copy the contents form the other directory and create a zipfile out of it. My Archive.zip file is blank.

    I guess some changes in functional map can help achieve.

     

    Please suggest.

     

    Thanks

     


    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 15.  Re: WTX email adapter for sending attachments

    Posted Thu May 23, 2019 06:07 AM
      |   view attached

    Originally posted by: PaulBrett


    Another copy of the maps, with adjustments made.

    Thank you.

    Paul

    Follow me on Twitter


    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange

    Attachment(s)

    zip
    ZipAndEmail2.zip   8 KB 1 version


  • 16.  Re: WTX email adapter for sending attachments

    Posted Fri May 24, 2019 03:52 AM
      |   view attached

    Originally posted by: PaulBrett


    Yes, the batch script needs to be altered to include the full path in the list, and the map needs to be altered to NOT add the map path at the start of each entry.

    Thank you.

    Paul

    Follow me on Twitter


    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender

    Attachment(s)

    zip
    ZipAndEmail3.zip   8 KB 1 version