Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display HTML page inside mail body with Email-ext plugin in Jenkins

I am new to Jenkins and I want to know how it is possible to display the HTML report (not the HTML code) generated after a successful build inside a mail body (not as an attachment).

I want to know the exact steps I should follow and what should be the content of my possible jelly template.

like image 440
HobbitOfShire Avatar asked Feb 27 '14 11:02

HobbitOfShire


People also ask

How do I add an HTML file to Jenkins workspace?

In your jobs (that generates the html files) go to configure -> Go to the post build section -> add a post build operation -> Archive the artifacts. Indicate the **/*. html files or just the name of the file you want to upload to the master and save.


1 Answers

Look deeper into the plugin documentations. No need for groovy here.

Just make sure Content Type is set to HTML and add the following to the body:

${FILE,path="my.html"} 

This will place the my.html content in your email body (location of file is relative to job's workspace. I use it and it works well.

I hope this helps.

EDIT: Note that you must have the Jenkins version 1.532.1 (or higher) to support this feature with the email-ext plugin.

like image 186
Eldad Assis Avatar answered Sep 20 '22 01:09

Eldad Assis