'How to attach files to Jenkins Pipeline notification

I am trying in a pipeline to attach files to my notification mails.

How can I do that? An example would be nice.



Solution 1:[1]

email-ext uses Ant File Syntax

As for example usage:

emailext attachmentsPattern: '**/report.html', body: 'Find attachments', subject: 'test', to: '[email protected]'

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 hakamairi