This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new ea7a83e  Automate naming
ea7a83e is described below

commit ea7a83e6d2ade1404d4ed66c9e85a7c0b371b04c
Author: Sebb <[email protected]>
AuthorDate: Fri Apr 24 12:10:09 2020 +0100

    Automate naming
---
 www/secretary/workbench/personalize.rb | 33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/www/secretary/workbench/personalize.rb 
b/www/secretary/workbench/personalize.rb
index 477ea60..786168a 100644
--- a/www/secretary/workbench/personalize.rb
+++ b/www/secretary/workbench/personalize.rb
@@ -4,24 +4,23 @@
 
 class Wunderbar::JsonBuilder
   def _personalize_email(user)
-    if user == 'clr'
-
-      @from = 'Craig L Russell <[email protected]>'
+    secs = Hash.new
+    ASF::Committee.officers.map{ |officer|
+      if officer.name == 'secretary' or officer.name == 'assistantsecretary'
+        secs[officer.chairs.first[:id]] = {
+          name: officer.chairs.first[:name],
+          office: officer.display_name,
+        }
+      end
+    }
+    sec = secs[user]
+    if sec
+      @from = "#{sec[:name]} <#{user}@apache.org>".untaint
       @sig = %{
-        --
-        Craig L Russell
-        Assistant Secretary, Apache Software Foundation
-      }
-
-    elsif user == 'mattsicker'
-
-      @from = 'Matt Sicker <[email protected]>'
-      @sig = %{
-        --
-        Matt Sicker
-        Secretary, Apache Software Foundation
-      }
-
+        -- 
+        #{sec[:name]}
+        #{sec[:office]}, Apache Software Foundation
+      }.untaint
     else
 
       person = ASF::Person.find(user)

Reply via email to