I started using Jenkins declarative pipelines. Now I want to have the same email notification behavior as defined in the Usage of the Mailer plugin:
- Every failed build triggers a new e-mail.
- A successful build after a failed (or unstable) build triggers a new e-mail, indicating that a crisis is over.
- An unstable build after a successful build triggers a new e-mail, indicating that there's a regression.
- Unless configured, every unstable build triggers a new e-mail, indicating that regression is still there.
I read about Notifications in Pipelines, but it does not notify based on above rules. Plus it does not contain part of the console output in the message body in case of a build failure.
Does anybody know how to do this in declarative pipeline?