title: Create post status notification method for all pipelines
body: <p>thanks in advance for the help.</p>
  <p>For our project, for which we use Jenkins, I'm working on a shared library to house all methods for our different pipelines (3 different ones).
  Currently I'm facing an issue, that I don't really know how to solve.</p>
  <p>I configured the jenkins-mattermost-plugin for the project. Ideally, I'd like to create one method for the <code>post</code> task in Jenkins that takes <code>currentBuild.currentResult</code> as an argument and returns the corresponding condition block and its message.</p>
  <p>Ex:</p>
  <ul>
  <li>if success:</li>
  </ul>
  <pre><code>  success {
      mattermostSend(...success build notification)
    }
  }
  </code></pre>
  <ul>
  <li>if failure:</li>
  </ul>
  <pre><code>  failure {
      mattermostSend(...failure build notification)
    }
  }
  </code></pre>
  <ul>
  <li>etc.</li>
  </ul>
  <p>The problem is not writing the method itself, but when to call it in the pipeline.
  I can't call it in a <code>stage</code> block, not without any block wrapper.</p>
  <p>I hope this makes sense what I'm trying to say.</p>