Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-51210

Jenkins Pipeline job is sending email with html tags when sends from master

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Critical Critical
    • email-ext-plugin
    • None

      Hi Team,

      We configured our Jenkins master in Windows machine and slave is in Linux machine.

      I configured jenkins pipeline job in master node, I restricted this job to run my slave (Linux). All the stages are working fine, but it is sending email with html tag.

      Do we need to configure content-type in pipeline configuration?

      PFB my pipeline script:

       

      node('Linux') {
          stage "Email Notification"
                  emailext (
                  to: 'rajasekaran.radhakrishnan@ge.com',
                  subject: "Python-Api-k8s-Test Email Notification",
                  body: """<html>
      <body>
      <style>
      table{
          border: 1px solid black;
          border-collapse: collapse;
          background-color: #D3FCFB;
      }

      th, td {
          border: 1px solid black;
          padding: 5px;
          text-align: left;
          }
          
      th, td#t01{
          border: 1px solid black;
          padding: 5px;
          text-align: left;
          background-color: #2890C8;
          }
          
          
      </style>
      <h3><b><i>Python-Api-k8s-Test Build Summary</i></b></h3>
      <table style="width:100%">
        <tr>
          <td id="t01"><b>Job Status</b></td>
          <td id="t01">Success</td>
        </tr>
        <tr>
          <td><b>Project</b></td>
          <td>Project1</td>
        </tr>
        <tr>
          <td><b>Environment</b></td>
          <td>Test</td>
        </tr>
         <tr>
          <td><b>Docker Image Version</b></td>
          <td>imagename:${env.BUILD_NUMBER}</td>
        </tr>
        <tr>
          <td><b>BUILD Logs</b></td>
          <td>${env.BUILD_URL}</td>
        </tr>
        </table>""",
                  recipientProviders: [[$class: 'DevelopersRecipientProvider']]
                )
              
      }

       

      Regards,

      Raja
       

          [JENKINS-51210] Jenkins Pipeline job is sending email with html tags when sends from master

          Raja R added a comment -

          davidvanlaatum can you please give some suggestions to fix.

          Raja R added a comment - davidvanlaatum can you please give some suggestions to fix.

          there is a content type parameter

          David van Laatum added a comment - there is a content type parameter

            davidvanlaatum David van Laatum
            raja_devops Raja R
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: