This is an automated email from the ASF dual-hosted git repository.
rubys pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 3682f9f notify authgroup members on changes
3682f9f is described below
commit 3682f9f668fbf2726d47796424bf13b650d561de
Author: Sam Ruby <[email protected]>
AuthorDate: Sun Aug 7 11:48:20 2016 -0400
notify authgroup members on changes
---
www/roster/views/actions/authgroup.json.rb | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/www/roster/views/actions/authgroup.json.rb
b/www/roster/views/actions/authgroup.json.rb
index a21fc09..558796e 100644
--- a/www/roster/views/actions/authgroup.json.rb
+++ b/www/roster/views/actions/authgroup.json.rb
@@ -23,9 +23,24 @@ if env.password
from = ASF::Person.find(env.user)
+ # default to sending the message to the group
+ to = group.members
+ to << person unless to.include? person
+ to.delete from unless to.length == 1
+ to = to.map {|person| "#{person.public_name} <#{person.id}@apache.org>"}
+
+ # replace with sending to the private@pmc list if this is a pmc owned group
+ pmc = ASF::Committee.find(group.id.split('-').first)
+ unless pmc.members.empty?
+ to = pmc.mail_list
+ to = "private@#{to}.apache.org" unless to.include? '@'
+ end
+
+ # construct email
mail = Mail.new do
from "#{from.public_name} <#{from.id}@apache.org>".untaint
- to "[email protected]"
+ to to
+ bcc "[email protected]"
subject "#{person.public_name} #{action} #{list}"
body "Current roster can be found at:\n\n" +
" https://whimsy.apache.org/roster/group/#{group.id}\n\n" +
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].