IBM Sterling Transformation Extender

Sterling Transformation Extender

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


#Sterling
#Supplychain
 View Only
  • 1.  Working with EMail adapter

    Posted 11/20/07 06:05 PM

    Originally posted by: Vana


    Hi,

    I have a file containing 5 email addresses

    abc@abc.com
    def@def.com
    ghi@ghi
    jkl@jkl.com
    mno@mno.com

    My map sends a text message "Hello World" to the above five email addresses using the PUT function.

    =VALID( PUT( "EMAIL" , "-SERVER mail.xyz.com -SUBJECT Hi -FROM pqr@pqr.com -TO " + Cust_Email Elements:In1 , " -T" ) , FAIL( "" ) )

    My map is sending the message only to the first two. My map is failing at third. (I deliberately put an invalid e-mail address there).
    The trace file shows the following message ....

    <hr />
    501 Syntax error in address ghi@ghi (F)
    Cannot deliver to recipient #1 (ghi@ghi).
    Attempt #1 failed, no more retries allowed.
    <RSET

    250 OK (S)
    <QUIT

    221 Closing connection. Good bye. (S)
    Socket Closed.
    Connection closed.
    WSATerm: Entering
    WSATerm: bWSStarted = 1, nWSClients = 393
    Sockets Client ID 393 disabled.
    WSATerm: nWSClients remaining = 392
    WSATerm: Exiting --
    Data in D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\47C.tmp deleted.
    Run Terminated at 17:00:13.437 on 11/20/07.
    <hr />
    Can someone please tell me how to implement validation here.

    Thnx in advance.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 2.  Re: Working with EMail adapter

    Posted 11/21/07 09:46 AM

    Originally posted by: NancyR


    If you use a type tree that looks something like this:
    File
    Recipient(s)
    Name
    EmailAddress
    URL
    Suffix

    where EmailAddress has an initiator of "@" and is infix delimited by ".". You might also want to use a restriction list for Suffix that includes com, edu, ...

    Put a restart attribute on Receient. Then your functional map that sends the emails will only send valid recipients. You can also create a second output card and use the REJECT function to capture any Recipient that fails type tree validation.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 3.  Re: Working with EMail adapter

    Posted 11/21/07 10:36 AM

    Originally posted by: Vana


    Thnx for the response. I have tried using the Restart attribute and Reject function, but it just does not work.
    My input tree has the email address Item, but there are no restrictions or component rules imposed.
    The output tree is a simple blob message for the PUT function.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 4.  Re: Working with EMail adapter

    Posted 11/21/07 11:13 AM
      |   view attached

    Originally posted by: jvanboga


    Something like the attached?
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender

    Attachment(s)



  • 5.  Re: Working with EMail adapter

    Posted 11/21/07 02:10 PM
      |   view attached

    Originally posted by: NancyR


    Yes. I made a few changes to your type tree in email_addr2.mtt which are detailed in the %%_ChangeHistory item to guarantee the WTX engine will catch errors during validation. The Reject attribute allows WTX to separate the valid email addresses and map them (even those that follow the one that's not valid). As you can see only the valid address are mapped to output card #1 while the invalid address(es) are mapped to output card #2 in the email_addr2 map.

    You can replace the rule in output card 1 with a functional map that sends your email to each valid email address.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender

    Attachment(s)



  • 6.  Re: Working with EMail adapter

    Posted 11/21/07 03:08 PM

    Originally posted by: Vana


    My requirement is to take the email address as fixed width string of size 50.
    I want a solution for
    1. if it is the correct e-mail address, the mail should reach him.
    OR
    1. if a particular recepient (eg. jkl@jkl.com) is not present
    2. if the email address is corrupt (like the one w/o .com)
    it should populate the reject log file, but it should continue processing the subsequent records.
    I think as soon as it encounters an invalid email, my server is closing the connection.....so do I need to open and close the for each mail ?????
    Any ideas and solns. are most welcome.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 7.  Re: Working with EMail adapter

    Posted 11/21/07 03:18 PM

    Originally posted by: jvanboga


    Nancy's updated tree and map is a good starting point for you. It will not help with failed emails due to a well formated but bad email address. It will catch poorly formated addresses.

    Usually, unless the email account is internal our emails don't fail due to domain rejecting an email address.

    To capture bad emails puts, you could override the email trace file name and interogate that file.

    Another option is use a valid email address as the sender then have a listener for rejected emails/messages returned due to bad addresses.

    You may need to incorporate several options depending on what you overall needs are.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 8.  Re: Working with EMail adapter

    Posted 11/26/07 12:24 PM

    Originally posted by: Vana


    Hi ,
    Hope u all had a wonderful Thanks Giving weekend, bagging great sales opportunities.
    Nancy, the solution was real cool, taking care of most of the exceptions.
    Thnx one again to all of u.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 9.  Re: Working with EMail adapter

    Posted 11/21/07 10:46 AM

    Originally posted by: SystemAdmin


    So if you have all good address, it works, is what you're saying?

    Possibly the "FAIL" is stopping it when the email send fails?

    At my current job, what they do when they want to report a faiuler as a failure, but not cause the map to fail is use "VALID(), RUNFAILMAP(LASTERRMMG+CODE+MAPNAME+ANYINFO YOU WANT IN AUDIT LOG), and that map has one output rule set to "FAIL()", so it always fails. That way, for each of the "VALID" statment that fails, you get it reported on like a failure, but the parent map continues processing.

    Message was edited by: rep

    Message was edited by: rep
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender