Display HTML page inside mail body with Email-ext plugin in Jenkins

后端 未结 6 2202
情书的邮戳
情书的邮戳 2020-11-30 00:58

I am new to Jenkins and I want to know how it is possible to display the HTML report (not the HTML code) generated after a successful build inside a mail body (not as an att

6条回答
  •  南方客
    南方客 (楼主)
    2020-11-30 01:56

    Besides reading the file with body: ${FILE,path="index.html"}, you need to set the proper content type, either globally or explicitly for one execution, with mimeType: 'text/html.

    emailext subject: '$DEFAULT_SUBJECT',
                        body: '${FILE,path="index.html"}',
                        recipientProviders: [
                            [$class: 'CulpritsRecipientProvider'],
                            [$class: 'DevelopersRecipientProvider'],
                            [$class: 'RequesterRecipientProvider']
                        ], 
                        replyTo: '$DEFAULT_REPLYTO',
                        to: '$DEFAULT_RECIPIENTS',
                        mimeType: 'text/html'
    

提交回复
热议问题