EmailExt- Jenkinsfile - HTML and CSS files are not embedded

612 Views Asked by At

EmailExt- Jenkinsfile - HTML and CSS files are not embedded

I am trying to attach html report in the email body and send the mail using Email-ext plugin.

 email-ext attachmentsPattern: "filePathToBeAttached", mimeType:'text/html', body: readFile("${env.WORKSPACE}/path_to_report.html"),to: [email protected]", subject:"test report"

But I could see plain HTML without proper formatting and absence of CSS styling in the email report sent.

Any help pls.

1

There are 1 best solutions below

0
user10888153 On

This is currently working for me. HTML is properly formatted in the mail, in outlook. I'm not using any css.

            unsuccessful {
            emailext mimeType: 'text/html',
            subject: "${PROJECT_NAME} - Build # ${BUILD_NUMBER} - ${BUILD_STATUS}!",
            body: readFile("${env.WORKSPACE}/JenkinsMailBody.html"),
            from: '[email protected]',
            replyTo: '[email protected]',
            recipientProviders: [culprits(), requestor()]
            }