Metersphere的消息通知支持自定义模板功能,我们公司使用邮件消息通知功能比较多些,Metersphere消息通知默认发送报告链接,报告内容太过于简单,接下来我给大家分享如何使用自定义模板去发送内容。
Metersphere版本
v2.2.1-68ccaa2a
一、自定义变量
Metersphere报告支持用变量拿到报告数据,比如:通过率、用例数,成功用例数、失败用例数等,具体有哪些变量可以去模板里查看
二、html模板设置
Metersphere邮件内容支持发送html内容,我们可以设置一个精美的html表格模板,列如:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<style type="text/css">
/*base css*/
a{color:#4a72af}
body{background-color:#e4e4e4}
body,p{margin:0;padding:0}
img{display:block}
h1,h2,h3,h4,h5,h6{margin:0 0 .8em 0}
h3{font-size:28px;color:#444!important;font-family:Courier New,Arial,Helvetica,sans-serif}
h4{font-size:22px;color:#4a72af!important;font-family:Courier New,Arial,Helvetica,sans-serif}
h5{font-size:18px;color:#444!important;font-family:Courier New,Arial,Helvetica,sans-serif}
p{font-size:12px;color:#444!important;font-family:"Courier New","Lucida Grande","Luci