title: Send an email on Jenkins pipeline failure
body: <p>How can I add to a Jenkins pipeline an old-style post-build task which sends email when the build fails? I cannot find &quot;Post-build actions&quot; in the GUI for a pipeline. I know that I can wrap the entire build script try/catch, however, this seems ugly when the build script is large and continues to send emails even when the job was aborted manually. I would like to achieve the same functionality as with the previous <code>email-ext</code> based post-build action.</p>
  <pre><code>try {
      // Do sth
  } catch(e) {
      emailext body: '$DEFAULT_CONTENT', 
          recipientProviders: [
              [$class: 'CulpritsRecipientProvider'],
              [$class: 'DevelopersRecipientProvider'],
              [$class: 'RequesterRecipientProvider']
          ], 
          replyTo: '$DEFAULT_REPLYTO', 
          subject: '$DEFAULT_SUBJECT',
          to: '$DEFAULT_RECIPIENTS'
      throw err
  }
  </code></pre>