[Email-ext] Add images to mail

977 views
Skip to first unread message

Maciej Gąsiorowski

unread,
Jun 13, 2014, 5:12:44 AM6/13/14
to jenkins...@googlegroups.com
Hi, I want to add images to mail body (from artifacts or workspace folder). It is possible ? I add img tag, where src is link to artifacts, in Email Template Testing everything is ok, but when jenkins send mail, there is no img src.

Best regards,
Maciej

Slide

unread,
Jun 13, 2014, 8:28:40 AM6/13/14
to Jenkins User Mailing List
If the recipient of the email is not on the network where those resources are available, you won't see them in the email. You can use the inlining option data-inline="true" in your HTML template and the plugin should inline images as base64 encoded, so they should display.


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Website: http://earl-of-code.com

Maciej Gąsiorowski

unread,
Jun 16, 2014, 8:34:15 AM6/16/14
to jenkins...@googlegroups.com
slide thanks for reply, but it doesn't solve my problem.

I want to add images that will be visible to all recipients, no matter if they are logged into Jenkins or not.

Any ideas ? :)

Slide

unread,
Jun 16, 2014, 8:39:40 AM6/16/14
to Jenkins User Mailing List

That's where the data-inline stuff comes in, the images will be inkined as base64 encoded data.

Maciej Gąsiorowski

unread,
Jun 16, 2014, 10:29:04 AM6/16/14
to jenkins...@googlegroups.com
But when I add this to img tag, this does not change anything. Maybe I am doing something wrong ?

Here is my code:

</table>
 <br />
 <h3>Icons:</h3>
 <table width="100%" cellpadding="0" cellspacing="0" style="font-family: Verdana, Helvetica, sans serif; font-size: 11px; color: black">
  <j:if test="${build.artifacts!=null and build.artifacts.size()!=0}">
   <j:forEach var="artifact" items="${build.artifacts}" varStatus="loop">
    <img src="${rooturl}${build.url}artifact/${artifact}" data-inline="true" />
   </j:forEach>
  </j:if>
</table>

Jeff Lett

unread,
Mar 2, 2015, 5:35:08 PM3/2/15
to jenkins...@googlegroups.com
Whats the preferred way to do this these days?

Rahul Bhatt

unread,
Jul 16, 2019, 11:02:07 AM7/16/19
to Jenkins Users
Does anyone get a solution on this? I am facing the same issue. EmailExt plugin sending email but not the image.

Viacheslav Dubrovskyi

unread,
Feb 12, 2020, 5:50:07 AM2/12/20
to jenkins...@googlegroups.com

Hi

You can insert link to image or add image inline as base64. https://www.bigfastblog.com/embed-base64-encoded-images-inline-in-html


16.07.2019 17:30, Rahul Bhatt пишет:
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
-- 
WBR,
Viacheslav Dubrovskyi
Reply all
Reply to author
Forward
0 new messages