Email snap with both pipeline variables and HTML table?

I need to produce an HTML email that includes both pipeline variable information in the HTML header and an HTML table that is a multiline error report. I can make one or the other work, but not both. The error report is being read from a database table. I want the email to look like:

Pipeline aaaa was run with parameters x, y, z

Error Report:

GUROUTP_LINE

POPULATION SELECTION EXTRACT
CONTROL REPORT PAGE 1

ERROR Parm 3 must be entered if 1 and 2 are
SQLCODE = 0000
SQL ERROR =
X01 ROLLBACK SQLCODE=0000
X01 COMMIT (1) SQLCODE=0000
SQLCODE = 0000
ORA-01403: no data found
DQY-ABORT ROLLBACK SQLCODE = 0000
ORA-01403: no data found

Hi @wpenfold

You’re probably close to your goal.

Make changes in your email sender snap like below:

I guess your Template body is OK, i.e. in the HTML you should have something like

...
<table> 
</table>
<br>
</body>
</html>

and before the email sender snap you should have a mapper like this one (note the $table object) that provides the $table:

That should be enough

/Igor

I created the table as you suggested ($list), but if I try to use it for table-data path, I get ‘Failure: invalid path, Reason: Snap failed unexpectedly and did not provide any reason’. Even though the output from the mapper seems good…

[

{

“job”:

“rorbpst”

“one_up_no”:

3370175

“exit_code”:

0

“output”:

“ORACLE_BASE environment variable is not being set since this\ninformation is not available for the current user ID snapuser.\nYou can set ORACLE_BASE manually if it is required.\nResetting ORACLE_BASE to its previous value or ORACLE_HOME\nThe Oracle base has been set to /u01/oracle/12.2.0.1/client\ndoing banner C programs\n”

“warning_message”:

“Connected.\nConnected.\n”

}

{

“list”:{

“line”:"\n"

}

}

{

“list”:{

“line”:" ELLUCIAN \n"

}

}

{

“list”:{

“line”:" POPULATION SELECTION EXTRACT \n"

}

}

{

“list”:{

“line”:" CONTROL REPORT PAGE 1 \n"

}

}

{

“list”:{…}

}

{

“list”:{…}

}

{

“list”:{…}

}

{

“list”:{…}

}

{

“list”:{…}

}

{

“list”:{…}

}

{

“list”:{…}

}

{

“list”:{…}

}

{

“list”:{…}

}

{

“list”:{…}

}

{

“list”:{…}

}

]

It appears I can only use $list if the table is the only input to the email snap. If I try to union in the header data I need to include in the email, then the snap objects

@wpenfold It is certainly possible to both use the table data, and a set of other fields in the email template.
I have an email sender which uses $group for the table, and then goes on to use a set of other fields (my summary data) in a footer. Those other fields are at the root level in my input document.

This is my template body:

"<!DOCTYPE html> 
<html> 
<head> 
     <title>My Title</title> 
<style type=\"text/css\"> table.Snap {background-color:transparent;border-collapse:collapse;width:50%;} table.Snap th, 
      table.Snap td {text-align:center;border:1px solid black;padding:5px;} table.Snap th {background-color:AntiqueWhite;} 
</style> 
</head> 
<body> 
        <table class=\"Snap\" ALIGN='CENTER'> 
        </table> 
<h2>My Extra Details</h2>
<table>
<tr></tr>
<tr><td>FIrst Line in my Custom Table</td><td>" + $One + "/ " + $Two + "/ " + $Total + "</td></tr>
<tr><td>Second Line</td><td>"  + $Three + "/ " + $Four + "</td></tr>
<tr><td>Third Line</td><td>"  + $Five + "/ " + $Six + "/ " + $TotalThree + "</td></tr>
</table>
<br><H2>A load of other stuff</H2><br>" + $SummaryChanges + "
</body> 
</html>"