Email ext to send html body in Pipeline

已查看 2,759 次
跳至第一个未读帖子

Sam K

未读,
2016年10月10日 01:21:282016/10/10
收件人 Jenkins Users
This works for most part.  Except, I have a html formatted file which I would like to send as the body.  Is it possible?  Thanks

emailext attachmentsPattern: '*.log, *.html', body: 'BUILD_URL = ' + env.BUILD_URL, subject: 'END Coded Pipeline Build SOURCE - ' + CODE_BRANCH + ' TESTS - ' + TEST_BRANCH, to: MAILING_LIST

Mark Bidewell

未读,
2016年10月11日 10:24:012016/10/11
收件人 Jenkins Users
Support for templates was added in 2.50 if that helps.

Sam K

未读,
2016年10月11日 14:26:582016/10/11
收件人 Jenkins Users
Thanks for bringing this to my attention Mark.  I was not aware of that.  The jelly scripts are great which send predefined content.  In my case, I am generating content which I want to send in the body.  

I am trying to work with mutt email client but having other roadblocks.  :(

Sam K

未读,
2016年10月12日 16:57:042016/10/12
收件人 Jenkins Users
Is there a plan to allow the ${FILE,path="${DIR}/test.html"} option that is already available in the plugin?  That is EXACTLY what most would want I presume.  :) 

Slide

未读,
2016年10月13日 10:10:292016/10/13
收件人 Jenkins Users

I believe that was added in 2.50 that was released recently.


--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/ba748cfd-f69b-485c-b797-51572934e22b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
已删除帖子

jer...@bodycad.com

未读,
2016年10月14日 12:57:152016/10/14
收件人 Jenkins Users
Hi,

I found the Jelly script way of doing it, see my post into this forum. does the  '${FILE,path="/tmp/test.html"}' does the Token replacement? can you use any form of script into it (for loop? jelly? groovy?).

Thanks

Sam K

未读,
2016年10月14日 19:07:022016/10/14
收件人 Jenkins Users
Hmm, not sure what you're asking...but the FILE,path along with the mimeType: 'text/html' does send any html file in the body of the email. 

jer...@bodycad.com

未读,
2016年10月17日 09:34:452016/10/17
收件人 Jenkins Users
Hi, Sam I was just wondering if the FILE type could use the token replacement like the follwoing:

<a href="${rooturl}${build.url}">Jenkins project</a>

into the email body. I tested it on my side just out of curiosity and it does not make the token replacement as of writting this.

For those who need it:
'${JELLY_SCRIPT,template="/tmp/test.jelly"}'  for Jelly template
or
'${SCRIPT,template="/tmp/test.template"}'  for groovy template

Slide

未读,
2016年10月17日 11:48:312016/10/17
收件人 Jenkins Users
rooturl and build are variables that are put into the binding for the Jelly and Groovy templating. They can't be used directly.

--
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.
回复全部
回复作者
转发
0 个新帖子