<< Back to previous view

[QB-3631] Embed .html Report in notification email with condition
Created: 21/Oct/20  Updated: 21/Oct/20

Status: Closed
Project: QuickBuild
Component/s: None
Affects Version/s: 9.0.48
Fix Version/s: None

Type: Task Priority: Major
Reporter: Phong Trinh Assigned To: Robin Shen
Resolution: Fixed Votes: 0
Remaining Estimate: Unknown Time Spent: Unknown
Original Estimate: Unknown


 Description   
 Hi,

 I would like to embed an .html report in notification email with other test reports. This .html report is embedded only if it exists. May you please advise me on how to set the email template for this?

 Thanks in advance,
ptrinh

 Comments   
Comment by Robin Shen [ 21/Oct/20 01:09 AM ]
Do you want to embed full content of html report including style into email notification template? If so, it will require iframe which will not be allowed by most email clients.
Comment by Phong Trinh [ 21/Oct/20 03:20 AM ]
 Thank you for promptly response, Robin. I would like to embed just contents of the .html report.
Comment by Robin Shen [ 21/Oct/20 06:01 AM ]
Assume you want to include index.html in workspace into email notification:

#set($htmlPathRelativeToWorkspace = "/index.html" )
#set($htmlPath = "$configuration.workspaceDir.absolutePath$htmlPathRelativeToWorkspace" )
#if ($util.getFile($htmlPath).exists())
  $util.readFileAsString($util.getFile($htmlPath))
#end
Comment by Phong Trinh [ 21/Oct/20 05:34 PM ]
 Thank you very much, Robin. I am going to give this a try and will keep you informed.
Comment by Phong Trinh [ 21/Oct/20 10:03 PM ]
This works fine for me. I made a small adjustment for using the report which was published to the server in one of the steps. Thank you very much.
Generated at Fri Apr 19 17:25:27 UTC 2024 using JIRA 189.