templatesjenkinsgroovyemail-ext

Creating custom groovy template for email-ext plugin


I am trying to send files of XML and pdf formats using Jenkins emailext plugin running pipeline. I don't have much idea on groovy script. Hence, following the given reference Running Groovy in Email Extension Plugin Jenkins I customised my code and used similar script. Still ended with: "Exception raised while parsing the groovy template error" Error similar to the error in shared reference. If anyone have any idea on writing custom .groovy template for email-ext plugin, please help me

Thanks in advance


Solution

  • You can attach any file using attachmentsPattern. The file has to reside in the workspace for this to work. So I'm suspecting you may be having an issue with your pattern.

    emailext attachmentsPattern: '**/report.pdf', body: 'Find attachments', subject: 'test', to: 'test@me.org'