I am trying in a pipeline to attach files to my notification mails.
How can I do that? An example would be nice.
Simple answer: Copy your file into the workspace(into your job directory), then under Attachment, just give the file name without any quotation or anything. This will automatically tell Jenkins to pick up your file. That's it!
For a project to use this plugin, you need to enable it in the project configuration page. In the Post-build Actions section, click on Add post-build action and then select Editable Email Notification. There are three main fields that you can edit when this plugin is enabled: Project Recipient List.
Enter the recipient email id in the 'E-mail Notification' box and select the checkbox next to the 'Send e-mail for every unstable build' option. Click the 'Advance Settings…' button in the 'Editable Email Notification' box. Click the 'Add Trigger' drop-down and select the 'Always' option and Click the 'Save' button.
email-ext uses Ant File Syntax
As for example usage:
emailext attachmentsPattern: '**/report.html', body: 'Find attachments', subject: 'test', to: '[email protected]'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With