Я пытаюсь отправить HTML-файл в самом теле письма (не во вложении). Я написал декларативный конвейер Дженкинса следующим образом
post {
always {
presendScript: "def reportPath=build.getWorkspace().child("target/serenity-summary.html")
msg.setContents(reportPath.readToString(), "text/html")"
emailext attachmentsPattern: "Serenity_Test_Results${env.BUILD_NUMBER}.zip" ,
body: "${currentBuild.currentResult}: Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} More info at: ${env.BUILD_URL}Unzip the attached document and click on index.html to view complete test results",
subject: "API Testing: Jenkins Job Results - Build # ${env.BUILD_NUMBER} - Failed",
mimeType: 'text/html',to: "xyz@abc.com"
}
}
Я получаю сообщение об ошибке следующим образом
WorkflowScript: 30: expecting anything but ''\n''; got it anyway @ line 30, column 102.
target/serenity-summary.html")
^
1 error
Мне нужно прикрепить HTML-файл к самому телу электронной почты, и мне нужен надлежащий presend скрипт в разделе post.