Jenkins configure mail notification

Keywords: jenkins

1. Configure the mail function of Jenkins:

First, set the email address of system administrator in system management system settings

 

Then configure the mailbox notification details below:

2. Add the post build operation in the project configuration, and select [E-mail Notification]

 

3. Configure the enhanced mail plug-in:

 

 

 

 

4. Add the post build operation in the project configuration, and select [Editable Email Notification]

 

 

In step 3, the Default Content of the message can be modified by yourself:

<!DOCTYPE html>   
<html>   
<head>   
<meta charset="UTF-8">   
<title>${ENV, var="JOB_NAME"}-The first ${BUILD_NUMBER}Secondary build log</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>   
            This email is sent by the system automatically, no need to reply!<br/>           
            Hello, colleagues. Here are ${PROJECT_NAME }Project construction information</br>
            <td><font color="#CC0000 "> build result - ${build_status} < / font ></td>  
        </tr>   
        <tr>   
            <td><br />   
            <b><font color="#0b610b "> construction information < / font ></b>   
            <hr size="2" width="100%" align="center" /></td>   
        </tr>   
        <tr>   
            <td>   
                <ul>   
                    <li>Project Name: ${PROJECT_NAME}</li>   
                    <li>Build No.: No ${BUILD_NUMBER}Secondary construction</li>   
                    <li>Trigger reason: ${CAUSE}</li>   
                    <li>Build status: ${BUILD_STATUS}</li>   
                    <li>Build log: <a href="${BUILD_URL}console">${BUILD_URL}console</a></li>   
                    <li>structure  Url :  <a href="${BUILD_URL}">${BUILD_URL}</a></li>   
                    <li>Working directory: <a href="${PROJECT_URL}ws">${PROJECT_URL}ws</a></li>   
                    <li>project  Url :  <a href="${PROJECT_URL}">${PROJECT_URL}</a></li>   
                </ul>   
 
<h4><font color="#0b610b "> failure case < / font > < H4 >
<hr size="2" width="100%" />
$FAILED_TESTS<br/>
 
<h4><font color="#0B610B">Recent submission(#$SVN_REVISION)</font></h4>
<hr size="2" width="100%" />
<ul>
${CHANGES_SINCE_LAST_SUCCESS, reverse=true, format="%c", changesFormat="<li>%d [%a] %m</li>"}
</ul>
Detailed submission: <a href="${PROJECT_URL}changes">${PROJECT_URL}changes</a><br/>
 
            </td>   
        </tr>   
    </table>   
</body>   
</html>

 

Posted by d3vilr3d on Wed, 13 Nov 2019 07:52:55 -0800