Add email footer token to identify if inline comments are present

Add a new mail template that is appended to the end of mails
related to users adding comments on changes.

The new template adds an extra token at the end of the mail:

  Gerrit-HasInlineComments: Yes

or

  Gerrit-HasInlineComments: No

which will be set depending on whether or not the reviewer has left
any inline comments.

This will allow users to filter their incoming notification emails
according to whether or not the review contains inline comments.

Bug: Issue 1531
Change-Id: Iafa5d69cc8a502c7afb1338dec681ca47c63338b
This commit is contained in:
David Pursehouse
2012-09-24 20:58:21 +09:00
parent f153f2b832
commit 85287c1663
5 changed files with 55 additions and 2 deletions

View File

@@ -30,7 +30,7 @@
## --------------
## The Comment.vm template will determine the contents of the email related to
## a user submitting comments on changes. It is a ChangeEmail: see
## ChangeSubject.vm and ChangeFooter.vm.
## ChangeSubject.vm, ChangeFooter.vm and CommentFooter.vm.
##
#if ($email.coverLetter || $email.hasInlineComments())
$fromName has posted comments on this change.

View File

@@ -0,0 +1,40 @@
## Copyright (C) 2012 The Android Open Source Project
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
##
## Template Type:
## -------------
## This is a velocity mail template, see: http://velocity.apache.org and the
## gerrit-docs:config-mail.txt for more info on modifying gerrit mail templates.
##
## Template File Names and extensions:
## ----------------------------------
## Gerrit will use templates ending in ".vm" but will ignore templates ending
## in ".vm.example". If a .vm template does not exist, the default internal
## gerrit template which is the same as the .vm.example will be used. If you
## want to override the default template, copy the .vm.example file to a .vm
## file and edit it appropriately.
##
## This Template:
## --------------
## The CommentFooter.vm template will determine the contents of the footer
## text that will be appended to emails related to a user submitting comments
## on changes.
##
## See ChangeSubject.vm and ChangeFooter.vm.
#if($email.hasInlineComments())
Gerrit-HasInlineComments: Yes
#else
Gerrit-HasInlineComments: No
#end