Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Sending an email according some condition

  1. #1

    Default Sending an email according some condition

    Hi!

    I would like to arrange a transformation in order to send different emails to different email addresses, according to the values of concrete fields (e.g. the value of a cell in a .xls document). If in this cell we have an A, we should send an email to A, if a B, email to B, etc...

    Which will be the best and more simple option?

    Thanks in advance

  2. #2
    Join Date
    Nov 2013
    Posts
    382

    Default

    Transformation Mail step does exactly that: send an email for every row using the row fields as values.

    Where is the problem?

  3. #3

    Default

    Quote Originally Posted by DepButi View Post
    Transformation Mail step does exactly that: send an email for every row using the row fields as values.

    Where is the problem?
    Sorry, which step exactly? Can I check and use a row from an attachment? and can I do it with different formats (.xls, .PDF, etc...)?

    Thanks in advance DepButi!

  4. #4
    Join Date
    Nov 2013
    Posts
    382

    Default

    Mail step.

    An attachment has no rows. Rows come from a previous step. So you need an step that reads your attachment and produces rows that will be fed to the next step on the flow.

    You need to understand how PDI works. It's a pipe system. Every step reads the rows from the pipe (from previous step), modifies/treats them in some specific way, and writes them to the pipe (to next step).

    Let me guess .... you are reading mails. So you need to identify the file name of the attachment. Then switch to an input step of the appropiate type and read the contents of the attachment. Now you have your rows on the pipe and they can be processed by the Mail step to send a mail with the required info.

    Am I right?

    Well, AFAIK the Transformation Email messages input step does not provide any way to know the name of the attachment. So you need to use a job Get mail step and save the attachment(s) in some specific folder. Now use a transformation with a Get file name step and do as explained.

  5. #5

    Default

    Quote Originally Posted by DepButi View Post
    Mail step.

    An attachment has no rows. Rows come from a previous step. So you need an step that reads your attachment and produces rows that will be fed to the next step on the flow.

    You need to understand how PDI works. It's a pipe system. Every step reads the rows from the pipe (from previous step), modifies/treats them in some specific way, and writes them to the pipe (to next step).

    Let me guess .... you are reading mails. So you need to identify the file name of the attachment.

    Well, I would need the name of the attachments, or maybe the Subject, or maybe some concrete word in the email´s Body...I consider all these different scenarios...


    Quote Originally Posted by DepButi View Post
    Then switch to an input step of the appropiate type and read the contents of the attachment. Now you have your rows on the pipe and they can be processed by the Mail step to send a mail with the required info.

    Am I right?

    Well, AFAIK the Transformation Email messages input step does not provide any way to know the name of the attachment. So you need to use a job Get mail step and save the attachment(s) in some specific folder. Now use a transformation with a Get file name step and do as explained.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.