Search code examples
pythonhtmljenkinspngemail-ext

Adding a png image and table html while sending email in Jenkins


I am using Jenkins email extension plugin and would like to do two things:

  1. Attach a png image to the email
  2. And also render html into the email message.

The email should contain both png image and rendered html.

If I attach png image and render html into message body using a pre-send script written in Groovy I do not get the attachment.

If I attach both html file and png image I get rendered image but the html file appears as a file attachment.

What should I do to get both html and img rendered in the email message body.

I have Jenkins ver. 1.614


Solution

  • Add your attachment and set default content with a path to html file. Pre-send script not needed for this:

    enter image description here

    Note: do not forget to set appropriate content type.