cancel
Showing results for 
Search instead for 
Did you mean: 

Email snap with both pipeline variables and HTML table?

wpenfold
New Contributor III

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

11 REPLIES 11

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>"

rfduboissl
New Contributor II

@cstewart, I’ve attempted to use your solution, but I need further info. Do you have a snapshot or examples of the mapper snap going into this email snap as well as the email snap, showing the configuration. I have the email type set as “HTML table” using your solution and my email snap continues to give me => Failure: Template body: $complete_PDW is undefined.
image
image

Below is the html in my template body:

"<DOCTYPE html>
<html>
<head></head>
<p>Good morning Team,Today’s DQC values for your review.</p>
<body>
<p>1. Attunity Load Items Status/Issues</p>
<ul></ul>
<li>a). Status – Complete.</li>
<li>b). Issues – No issues</li>
<p>2.	PDW Load Items Status/Issues</p>
<table border=1>
<tr></tr>
<tr><td>PDW               – Completed at: </td><td>" + $complete_PDW + " </td></tr>
<tr><td>CALL Center       – Completed at: </td><td>"  + $complete_CC  + " </td></tr>
<tr><td>SpecRx            – Completed at: </td><td>"  + $complete_SPECRX + " </td></tr>
<tr><td>MHK               – Completed at: </td><td>"  + $complete_MHK + " </td></tr>
<tr><td>Reporting Cluster – Completed at: </td><td>"  + $complete_RPT_Cluster + " </td></tr>
</table>
<li>f)	Issues :  None</li>
</body>
</html>"

@rfduboissl because you have Table-driven path set to $table, it’s trying to find $complet_PDW within that, but base on your JSON image it is not within a $table but at the same level.

I think you want to set your email type to HTML Text since you are explicitly listing the fields in the HTML. If you use HTML table as the Email type, it will append the table in the HTML.


Diane Miller

rfduboissl
New Contributor II

Diane …

Thanks you for the reply.

I DID figure this out and have it working.

I will post the solution.

Rich

image001.jpg

rfduboissl
New Contributor II

1). Data going into the email snap … the $variables must be at the same level as the table, ( I had each of them coming in as separate documents).

image001.png

2). email type is HTML table, Table data path is $table

image005.png

3). Final Template body html is:

"

Good morning Team,Today’s DQC values for your review.

1. Attunity Load Items Status/Issues

  • a) Status – Complete.
  • b) Issues – No issues
  • 2. PDW Load Items Status/Issues

    • a) PDW – Completed at " + $complete_PDW + "
    • b) CALL Center – Completed at " + $complete_CC + "
    • c) SpecRx – Completed at " + $complete_SPECRX + "
    • d) MHK – Completed at " + $complete_MHK + "
    • e) Reporting Cluster – Completed at " + $complete_RPT_Cluster + "
    • f) Issues : None
    • 3. Please find the DQC errors in the below table

      "

      image001.jpg