How to embed html report in email body using Email-ext plugin?

Issue

How do I email a html report generated in a job build (located in workspace) in an email notification?

I also want to ensure that the html report is embedded in the email body.

Environment

Resolution

In Post-build actions - Editable Email Notification

  • Ensure Content Type is set to html.
  • In Default Content add ${FILE,path="my.html"}. Replace my.html with your html file. Path is workspace relative.
Have more questions? Submit a request

3 Comments

  • 1
    Avatar
    Tanu Muk2009

    Doesn't work. It does embed in the body of the email, but the css ad html files aren't embedded! Looks so unfinished! 

  • 0
    Avatar
    Rakesh Adupa

    Same here. did You find solution for that

  • 0
    Avatar
    Cassandra Rodriguez

    similar - this worked for me though:

     

    1. Add this to build: execute shell section:

    echo count=$count > count.txt
    echo distinctcount=$distinctcount > distinctcount.txt

    2. Add this to Inject Environmental Variables section under "Properties File Path:

    ${WORKSPACE}/count.txt

     

    ANOTHER SEPARATE PROPERTIES FILE PATH (as I have two variables)

    ${WORKSPACE}/distinctcount.txt

    (note: workspace is pwd for jenkins and lists the location)

     

    3. Call the variable in the "default content" section of "editable email notification":

    Count total:$count Distinct Count: $distinctcount

     

    **NOTE**

    Be sure you have email setup as "always" under "advanced settings" at the bottom of the email settings, otherwise it only emails upon first success or any faillure:



    Edited by Cassandra Rodriguez
Please sign in to leave a comment.