Introduction
Sometimes you want Jenkins to send messages only when certain things happen, like a build failing or succeeding. Custom notification logic lets you control exactly when and how Jenkins sends these messages to your team.
When you want to send a Slack message only if the build fails.
When you want to email the team only if tests fail but skip notifications on success.
When you want to notify different people depending on the branch being built.
When you want to send a summary notification after multiple jobs finish.
When you want to avoid spamming notifications for repeated failures.