Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Formating message mail

  1. #1
    Join Date
    Nov 2013
    Posts
    382

    Default Formating mail message

    Hi,
    I'm using a mail step to send a message to some users when some specific situation occurs. It's working fine, but right now the message itself is just plain text, stored in a field using an "Add constants" step.

    I would like my message to be clearer adding the values of some fields. Something like ...

    "Process xxxx identified some incorrect values: " & value1 & " / " & value2

    where value1 and value2 are already existing fields.

    Is there any way to create such a message? I cannot find it.

    Thks
    Last edited by DepButi; 01-20-2014 at 05:43 AM.

  2. #2
    Join Date
    Dec 2010
    Posts
    193

    Default

    Hi,

    You can use HTML tags inside Mail step and place the variables accordingly inside HTML body . It will work Perfectly .

    Example:
    <html><body bgcolor="">
    <font font properties>"Process xxxx identified some incorrect values:$Variable1 (variable set previously)</font>
    </body></html>
    Sathish
    Back to Pentaho


    'Be the best Pearl in the ocean of wisdom'

  3. #3
    Join Date
    Nov 2013
    Posts
    382

    Default

    Thanks for the answer, but I must be doing something wrong. There is no variable substitution. All I get is exactly what I type as the value of my field on the add constants step.

    The whole transformation goes like

    table input -> table output --(error handling hop)--> add constants -> mail

    On add constants I define the needed fields to be used on the mail step (all of them string):
    Server
    Port
    Sender
    Sender pwd
    Receiver
    Message "This is a test $code</br></br>Thanks."

    Where $code is the name of one field generated on the input/output table steps.

    ... and all I get is a message that reads exactly
    This is a test $code

    Thanks.
    Obviously I would like to get a message saying
    This is a test 12345

    Thanks.
    12345 being the value of $code for the erroneous row.

    What am I doing wrong?

    Thks
    Last edited by DepButi; 01-20-2014 at 10:46 AM. Reason: spelling

  4. #4
    Join Date
    Nov 2013
    Posts
    382

    Default

    OK, solved. I was using an "Add constants" step and no variable substitution was done. I changed it to a "Formula" step to build up my full message. Working fine now.

    Thanks

  5. #5
    Join Date
    Dec 2010
    Posts
    193

    Default

    One more tip. Well, you can use colour codes for failure messages using font color tag and success messages just to differentiate the outcome. Also, you can pass a query output as HTML table also. Cheers.
    Sathish
    Back to Pentaho


    'Be the best Pearl in the ocean of wisdom'

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.