Tuesday, 26 December 2017

TechTip - How to embed html report within the Jenkins email notifications?

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:
  1. Go to your jenkins job and click on Configure.
  2. Go to Post Build Actions and then select Editable Email Notifications
  3. Select Content Type as HTML(text/plain)
  4. In the default content section replace $DEFAULT_CONTENT with following
           ${FILE,path=”relative path to html file”}

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.




16 comments:

  1. I am always searching online for articles that can help me. There is obviously a lot to know about this. I think you made some good points in Feat ures also. Keep working, great job! Edmonton laser hair removal

    ReplyDelete
  2. when i am using this procedure, i am getting same path as string in my email body, not html report. I selected default content type as HTML type.

    ReplyDelete
    Replies
    1. I'm getting the same issue. Is anyway to fix this?

      Delete
    2. Hi Bharath,

      Please provide complete path of the report.html file.

      Delete
  3. below code embeds the report content in email body
    use pre tag(this editor not allowing to add pre tag)
    pre
    ${FILE,path="report/report.html"}
    /pre

    ReplyDelete
  4. Hello
    I am using following in the path:
    ${FILE,path="C:/Cucumber/report/index_E2E.html"}

    I am able to see the HTML and tags in it. but the 2 PNG files which are pie charts for the pass - Failed scenarios, is not showing.
    Instead only a small cross in a box is displayed.

    When I am opening the index_E2E.html, I am able to see the png files correctly.
    Ever faced this issue?

    ReplyDelete
  5. Same issue in my case as well

    ReplyDelete
  6. I am always getting same path as string in my email body

    ReplyDelete
  7. It is not fetching the desired output, it is simply dumping the {FILE} part on the email.Any suggestions?

    ReplyDelete
  8. hi , UI not showing properly in the email can you help me on this.

    ReplyDelete
  9. using the same steps integrated for extent report but the report not showing properly in the email . Please give any suggestion.

    ReplyDelete
  10. SHREE SAI PACKERS AND MOVERS
    #18/3, 30ft road,, sri krishna colony,
    kuduregere main road,, alur post,
    Bangalore, Karnataka 562123
    080736 70915
    Packers and movers bangalore

    Guru TV Repair
    52 shampura main road, Munni veerappa layout
    Kaval bairasandra
    Bengaluru, Karnataka 560032
    080888 33910
    Led tv repair in bangalore

    Graphica Gauges and Tools
    S. No. 37, Ramnagar, Ramnagar Tempo Chowk,Vadgoensheri
    Pune, Maharashtra 411014
    098508 84992
    Thread Ring Gauges

    iRobo Wellness Private Limited
    AryaHub Mall No. 22
    Hope farm Junction Whitefield
    Bangalore, Karnataka 560066
    099806 58125
    Massage chair

    ReplyDelete
  11. Where to play at LuckyDays Casino? - DrMCD
    Lucky Days Casino was in town the night before 여수 출장샵 the 계룡 출장안마 casino was opened in 순천 출장마사지 and Lucky 경상북도 출장마사지 Days Casino is a 화성 출장샵 very large casino in the state of

    ReplyDelete