Hello,
my requirement is to send a report by email containing a table with data.
This data is read from a database and transformed into a table in html format.
I basically pass a variable that already contains the formatted table, but the email I receive shows not the table in graphic format but the html code.
Which IIQ version are you inquiring about?
Version 8.3p3
Please share any images or screenshots, if relevant.
I have also tried using VTL to generate an html table but I get the same result. Does anyone have any idea how I can solve this?
Thank you very much for your possible help.
Also, just for your information, any message body written as HTML must be contained within a CDATA section. Kindly validate.
<Body><![CDATA[
<html>
<body style="background:#FFF;margin:0;padding:0;text-align:left;">
<p style="margin:20px 0 0;padding:0;color:#333;font:bold 10pt Arial;line-height:15pt;">$!{workItem.owner.firstname},</p>
<p style="margin:0 0 20px;padding:0;color:#333;font:normal 10pt Arial;line-height:15pt;">As part of our periodic compliance efforts, you are responsible for certifying the access your employees have to enterprise applications. </p>
<p style="margin:0;padding:0;color:#333;font:normal 10pt Arial;line-height:15pt;">A specific access certification is named <b>$!{workItemName}</b> has been created for you, and is due on <strong>$spTools.formatDate( $certification.expiration,3,3)</strong>. <a href="http://localhost:8080/identityiq/manage/certification/entityList.jsf?certificationId=$!{certification.id}">Click here to get started on this task.</a></p>
</body>
</html>
]]> </Body>
How you’re triggering that email? via code or by OOTB?
If email is triggering from code are you passing input argument correctly?
Validate Email. I can see that header and body tag has “<” and table tag has “<”. Remember Email templates is written in XML file. So you need to convert “<” into “<” or use CDATA as mentioned by @officialamitguptaa .
I have of course tried to insert the CDATA in the template definition in xml, but every time I save on SailPoint it it escapes the special characters and when I reopen the xml I find it like this.
First answer:
The email is sent via a Rule that reads information from a db and formats it in html.
The idea was to send the email template the data ready to be displayed.
Have you ever had to send an email with data extracted from an oracle table for example? If so, how did you do it?
Second answer:
Yes, I checked and the rule sends the parameters that way:
Third answer:
I fixed that part, it is now correct, only the part of the html table passed to the emailtemplate still has the problem.
What it seems to me is that although I construct the string in this way:
I haven’t tried fetch the data from DB and passing to email template. My is guess the parameter that you’re passing is taking as a string. Can you try below code?
Bye,
the include does not work, that is for importing files into the template. If I apply the change you suggested, I get this error:
Caused by: org.apache.bsf.BSFException: The application script threw an exception: sailpoint.tools.GeneralException: Unable to find resource '<div style='overflow-x:auto;'>
But thanks to the link you sent me I found the solution, instead of using the include you have to use the evaluate, now it works, I just have to adjust the aesthetics a bit.