threads / discuss / 40400

email sender plugin in stash

Subject: email sender plugin in stash

## tl;dr

2 messages between Sep 22, 2015 and Sep 22, 2015.

replies: 1people: 2as markdown or json

Ankit Jain· Sep 22, 2015, 05:35 UTC · lore
HI

I need to modify the notifyemail.vm plugin to show only those changes in the email which i committed as a part of pull request. I do not want to see all the commits which happen again and again during the review process.

We actually squash all the commits and the reviewer always see the diff with respect to the master branch,.. but when the mail is send it shows the actual merge commit and also the parent commits.

We do not want to show the parent commit only show the merge commit.
What changes we need to do in "notifyemail.vm" to achieve the same

https://bitbucket.org/slyoldfox/notifier/src/b160edc865961baed7861b1b7dc5b1bfe1 587fb5/src/main/resources/templates/notifyemail.vm?fileviewer=file-view-default

Andrew Ardill· Sep 22, 2015, 05:53 UTC · re: Ankit Jain · lore

Re: email sender plugin in stash

Hi Ankit,
On 22 September 2015 at 15:35, Ankit Jain <ankitgr8@gmail.com> wrote:
Show 5 quoted lines
> HI
>
> I need to modify the notifyemail.vm plugin to show only those changes in the
> email which i committed as a part of pull request. I do not want to see all the
> commits which happen  again and again during the review process.

As this is the git developer mailing list, you'll probably get better assistance over at the Atlassian Answers website https://answers.atlassian.com/

Essentially what you need to do is adjust the list of changesets to
display. In the given template, the changesets are grabbed using the
function
    smtpNotificationRenderer.getChangesetPage(repository, refChange)

You need to either filter that list, or alternatively write your own helper to get only the changesets you care about.

Filtering would be relatively straight forward, using either changeset.author.name or changeset.author.emailAddress if you want to filter on whose commits are included, or changeset.parents if you only want to include merge commits. There are plenty of options for more complex filtering, but that might be able to help

Regards,
Andrew Ardill

← back to recent threads