title: Setting Jenkins to email a build notification to the BitBucket user who pushed a branch
body: <p>A project repository has been successfully connected to a Jenkins server using the <a href="https://wiki.jenkins-ci.org/display/JENKINS/BitBucket+Plugin" rel="nofollow">BitBucket plugin</a>, and a project set up such that:</p>
  
  <ul>
  <li>Each push to a branch in BitBucket will trigger a webhook sent to the Jenkins server</li>
  <li>When the Jenkins server receives the webhook it will build the changed branch (by specifying branch name as <code>**</code> in the config)</li>
  <li>After the build is complete a notification is sent back to BitBucket of the build status using the <a href="https://wiki.jenkins-ci.org/display/JENKINS/Bitbucket+Build+Status+Notifier+Plugin" rel="nofollow">BitBucket notifier</a></li>
  </ul>
  
  <p>Each of these has been easy to set up with just the instructions in the plugin and a few quick Googles. However I've now run into a problem which is maybe more a matter of wanting to run in an unconventional manner than anything else.</p>
  
  <p>Using the normal emailer plugin or the Email-ext plugin it's possible to set emails to send to people involved in the creation of a build. For example the Email-ext plugin allows choice of:</p>
  
  <ul>
  <li>Requester</li>
  <li>Developers (all people who have commits in the build based off its last version)</li>
  <li>Recipient list (a pre-set list)</li>
  <li>Various "blame" settings for broken builds</li>
  </ul>
  
  <p>The development process being followed involves each project being worked on by one developer in a named branch, e.g. <code>userA/projectB</code>. Obviously other developers could check that out and push to make changes but that's frowned upon. Even in that instance, the user who <em>pushes</em> the change to BitBucket should be notified.</p>
  
  <p>None of the current settings support this. <em>Requester</em> is the closest, but that only works for manual builds. It seems a very simple requirement that the push to SCM that triggered a build should notify the user who pushed, but this is not documented anywhere that is easy to find.</p>