If you would like to send html report through Jenkins email notifications and looking for how to embed html report within the Jenkins email notifications, you can follow below steps:
Prerequisite
Ensure that your Jenkins has email-ext-plugin installed. If not, refer this and install it first.
Steps
Follow below steps to embed html file in email content:
Example
For example, below is the absolute path for your html file. So you just need to pick bold marked as relative path and mention in path.
/app/jenkins/jobs/myjob/workspace/my-maven-module/target/site/surefire-report.html
${FILE,path="my-maven-module/target/site/surefire-report.html”}
This will place the surefire-report.html content in your email body.
Hope this tip is helpful for you.
Prerequisite
Ensure that your Jenkins has email-ext-plugin installed. If not, refer this and install it first.
Steps
Follow below steps to embed html file in email content:
- Go to your jenkins job and click on Configure.
- Go to Post Build Actions and then select Editable Email Notifications
- Select Content Type as HTML(text/plain)
- In the default content section replace $DEFAULT_CONTENT with following
Example
For example, below is the absolute path for your html file. So you just need to pick bold marked as relative path and mention in path.
/app/jenkins/jobs/myjob/workspace/my-maven-module/target/site/surefire-report.html
${FILE,path="my-maven-module/target/site/surefire-report.html”}
This will place the surefire-report.html content in your email body.
Hope this tip is helpful for you.