Jenkins:(看起来挺好看的)邮件模板样式

邮件模板样式一【根据样式三改编,背景图自定义】

在这里插入图片描述

<!-- #######  YAY, I AM THE SOURCE EDITOR! #########-->

<body>

    <head>
        <STYLE TYPE="text/css">
            BODY {
                background-image: URL(http://xx 你的图片外放可访问的URL xx.jpg);
                background-position: center;
                background-repeat: no-repeat;
                background-attachment: fixed;
                background-size:100% 100%;
                font-size: 20px;
            }
        </STYLE>
    </head>
    <h2 style="color: #5e9ca0; text-align: center;">PS:(本邮件为自动化报告邮件,请下载附件查阅,不支持在线预览!)</h2>
    <table class="editorDemoTable" style="height: 273px;" width="100%">
        <thead>
            <tr>
                <td nowrap="nowrap" style="background-color: #3498db; text-align: center;" colspan="2">
                    <h2><span style="color: #000000;">${PROJECT_NAME}自动化测试报告</span></h2>
                </td>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td nowrap="nowrap" style="border-color: gray;text-align: center;"><span style="color: #808000;">项目名称:</span></td>
                <td nowrap="nowrap" style="border-color: gray;text-align: center;"><span style="color: #808000;">$PROJECT_NAME</span></td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="border-color: gray;text-align: center;"><span style="color: #808000;">构建编号:</span></td>
                <td nowrap="nowrap" style="border-color: gray;text-align: center;"><span style="color: #808000;">$BUILD_NUMBER</span></td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="border-color: gray;text-align: center;"><span style="color: #808000;">构建状态:</span></td>
                <td nowrap="nowrap" style="border-color: gray;text-align: center;"><span style="color: #808000;">$BUILD_STATUS</span></td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="border-color: gray;text-align: center;"><span style="color: #808000;">触发原因:</span></td>
                <td nowrap="nowrap" style="border-color: gray;text-align: center;"><span style="color: #808000;">${CAUSE}</span></td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="border-color: gray;text-align: center;"><span style="color: #808000;">构建日志地址:</span></td>
                <td nowrap="nowrap" style="border-color: gray;text-align: center;"><span style="color: #00ccff;">&nbsp;<a style="color: #00ccff;" title="构建日志" href="${BUILD_URL}console">${BUILD_URL}console</a></span></td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="border-color: gray;text-align: center;"><span style="color: #808000;">构建地址:</span></td>
                <td nowrap="nowrap" style="border-color: gray;text-align: center;"><span style="color: #00ccff;">&nbsp;<a style="color: #00ccff;" title="构建地址" href="$BUILD_URL">$BUILD_URL</a></span></td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="border-color: gray;text-align: center;"><span style="color: #808000;">测试报告地址:</span></td>
                <td nowrap="nowrap" style="border-color: gray;text-align: center;"><span style="color: #00ccff;"><a style="color: #00ccff;" title="测试报告地址" href="${WORKSPACE}\report\htmlExtraReport.html">${WORKSPACE}\report\htmlExtraReport.html</a></span></td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="border-color: gray;text-align: center;"><span style="color: #808000;">测试日志地址:</span></td>
                <td nowrap="nowrap" style="border-color: gray;text-align: center;"><span style="color: #00ccff;">&nbsp;<a style="color: #00ccff;" title="测试日志地址" href="${BUILD_URL}log.html">${BUILD_URL}log.html</a></span></td>
            </tr>

            <tr>
             <td colspan="2">
               <b>
                <hr size="2" width="100%"  align="center" />
              </b>
             </td>
            </tr>

        <tr>
          <td colspan="2"><b><font color="#0B610B">构建情况总览【仅展示250行构建内容】:</font></b>${TEST_COUNTS,var="fail"}<br/><br></td>
        </tr>
        <tr>
            <td colspan="2"><pre cols="160" rows="80" style="font-family: Courier New">${BUILD_LOG,maxLines=250}</pre>
            </td>
        </tr>

        </tbody>
    </table>
</body>

邮件模板样式二

模板来源:https://blog.csdn.net/shenshenruoxi/article/details/106222851

在这里插入图片描述

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>${PROJECT_NAME}-第${BUILD_NUMBER}次构建日志</title>
</head>
 
<body leftmargin="8" marginwidth="0" topmargin="8" marginheight="4"
    offset="0">
    <table width="95%" cellpadding="0" cellspacing="0"
        style="font-size: 11pt; font-family: Tahoma, Arial, Helvetica, sans-serif">
        <tr>
            <td>(本邮件是程序自动下发的,请勿回复!)<br/></td>
        </tr>
        <tr>
            <td><h2>
                    <font color="#0000FF">构建结果 - ${BUILD_STATUS}</font>
                </h2></td>
        </tr>
        <tr>
            <td><br />
            <b><font color="#0B610B">构建信息</font></b>
            <hr size="2" width="100%" align="center" /></td>
        </tr>
        <tr>
            <td>
                <ul>
                    <li>项目名称 : ${PROJECT_NAME}</li>
                    <li>构建编号 : 第${BUILD_NUMBER}次构建</li>
                    <li>触发原因: ${CAUSE}</li>
                    <li>构建日志: <a href="${BUILD_URL}console">${BUILD_URL}console</a></li>
                    <li>构建  Url : <a href="${BUILD_URL}">${BUILD_URL}</a></li>
                    <li>工作目录 : <a href="${PROJECT_URL}ws">${PROJECT_URL}ws</a></li>
                    <li>项目  Url : <a href="${PROJECT_URL}">${PROJECT_URL}</a></li>
                </ul>
            </td>
        </tr>
        <tr>
            <td><b><font color="#0B610B">Changes Since Last Successful Build:</font></b>
            <hr size="2" width="100%" align="center" /></td>
        </tr>
        <tr>
            <td>
                <ul>
                    <li>历史变更记录 : <a href="${PROJECT_URL}changes">${PROJECT_URL}changes</a></li>
                </ul> ${CHANGES_SINCE_LAST_SUCCESS,reverse=true, format="Changes for Build #%n:<br />%c<br />",showPaths=true,changesFormat="<pre>[%a]<br />%m</pre>",pathFormat="    %p"}
            </td>
        </tr>
        <tr>
            <td> <hr size="2" width="100%" align="center" /></td>
        </tr>
        <tr>
            <td></td>
        </tr>
        <tr>
            <td><b><font color="#0B610B">构建情况总览:</font></b>${TEST_COUNTS,var="fail"}<br/>
            <hr size="2" width="100%" align="center" /></td>
        </tr>
        <tr>`在这里插入代码片`
            <td><textarea cols="80" rows="30" readonly="readonly"
                    style="font-family: Courier New">${BUILD_LOG,maxLines=23}</textarea>
            </td>
        </tr>
    </table>
</body>
</html>

邮件模板样式三

模板来源:https://blog.csdn.net/Jasonliujintao/article/details/74372717

在这里插入图片描述

<!-- #######  YAY, I AM THE SOURCE EDITOR! #########-->

<body>

    <head>
        <STYLE TYPE="text/css">
            BODY {
                background-image: URL(http://pic1.win4000.com/wallpaper/2/57887791aba6b.jpg);
                background-position: center;
                background-repeat: no-repeat;
                background-attachment: fixed;
                background-size:100% 100%;
            }
        </STYLE>
    </head>
    <h2 style="color: #5e9ca0; text-align: center;">PS:(本邮件是自动化测试邮件,请勿回复!)</h2>
    <table class="editorDemoTable" style="height: 273px;" width="430">
        <thead>
            <tr>
                <td nowrap="nowrap" style="background-color: #3498db; text-align: center;" colspan="2">
                    <h2><span style="color: #000000;">自动化测试报告</span></h2>
                </td>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td nowrap="nowrap" style="border-color: gray;"><span style="color: #808000;">项目名称:</span></td>
                <td nowrap="nowrap" style="border-color: gray;"><span style="color: #808000;">$PROJECT_NAME</span></td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="border-color: gray;"><span style="color: #808000;">构建编号:</span></td>
                <td nowrap="nowrap" style="border-color: gray;"><span style="color: #808000;">$BUILD_NUMBER</span></td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="border-color: gray;"><span style="color: #808000;">构建状态:</span></td>
                <td nowrap="nowrap" style="border-color: gray;"><span style="color: #808000;">$BUILD_STATUS</span></td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="border-color: gray;"><span style="color: #808000;">触发原因:</span></td>
                <td nowrap="nowrap" style="border-color: gray;"><span style="color: #808000;">${CAUSE}</span></td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="border-color: gray;"><span style="color: #808000;">构建日志地址:</span></td>
                <td nowrap="nowrap" style="border-color: gray;"><span style="color: #00ccff;">&nbsp;<a style="color: #00ccff;" title="构建日志" href="${BUILD_URL}console">${BUILD_URL}console</a></span></td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="border-color: gray;"><span style="color: #808000;">构建地址:</span></td>
                <td nowrap="nowrap" style="border-color: gray;"><span style="color: #00ccff;">&nbsp;<a style="color: #00ccff;" title="构建地址" href="$BUILD_URL">$BUILD_URL</a></span></td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="border-color: gray;"><span style="color: #808000;">测试报告地址:</span></td>
                <td nowrap="nowrap" style="border-color: gray;"><span style="color: #00ccff;"><a style="color: #00ccff;" title="测试报告地址" href="${BUILD_URL}robot/report/report.html">${BUILD_URL}robot/report/report.html</a></span></td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="border-color: gray;"><span style="color: #808000;">测试日志地址:</span></td>
                <td nowrap="nowrap" style="border-color: gray;"><span style="color: #00ccff;">&nbsp;<a style="color: #00ccff;" title="测试日志地址" href="${BUILD_URL}robot/report/log.html">${BUILD_URL}robot/report/log.html</a></span></td>
            </tr>
        </tbody>
    </table>
</body>

邮件模板样式四

在这里插入图片描述

<!DOCTYPE html>    
<html>    
<head>    
<meta charset="UTF-8">    
<title>${ENV, var="JOB_NAME"}-第${BUILD_NUMBER}次构建日志</title>    
</head>    
    
<body leftmargin="8" marginwidth="0" topmargin="8" marginheight="4"    
    offset="0">    
    <table width="95%" cellpadding="0" cellspacing="0"  style="font-size: 11pt; font-family: Tahoma, Arial, Helvetica, sans-serif">    
        <tr>    
            本邮件由系统自动发出,无需回复!<br/>            
            各位同事,大家好,以下为${PROJECT_NAME }项目构建信息</br> 
            <td><font color="#CC0000">构建结果 - ${BUILD_STATUS}</font></td>   
        </tr>    
        <tr>    
            <td><br />    
            <b><font color="#0B610B">构建信息</font></b>    
            <hr size="2" width="100%" align="center" /></td>    
        </tr>    
        <tr>    
            <td>    
                <ul>    
                    <li>项目名称 : ${PROJECT_NAME}</li>    
                    <li>构建编号 : 第${BUILD_NUMBER}次构建</li>    
                    <li>触发原因: ${CAUSE}</li>    
                    <li>构建状态: ${BUILD_STATUS}</li>    
                    <li>构建日志: <a href="${BUILD_URL}console">${BUILD_URL}console</a></li>    
                    <li>构建  Url : <a href="${BUILD_URL}">${BUILD_URL}</a></li>    
                    <li>工作目录 : <a href="${PROJECT_URL}ws">${PROJECT_URL}ws</a></li>    
                    <li>项目  Url : <a href="${PROJECT_URL}">${PROJECT_URL}</a></li>    
                     <li>测试报告: <a href="${PROJECT_URL}allure">${PROJECT_URL}allure</a></li> 
                </ul>    

<h4><font color="#0B610B">失败用例</font></h4>
<hr size="2" width="100%" /> $FAILED_TESTS<br/>
            </td>    
        </tr>    
    </table>    
</body>

  • 5
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值