whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject [whimsy] branch master updated: project/icla add roughed-in vote processing
Date Wed, 31 Jan 2018 04:02:41 GMT
This is an automated email from the ASF dual-hosted git repository.

clr 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 bdabbdd  project/icla add roughed-in vote processing
bdabbdd is described below

commit bdabbdd7d3db49f0e671d966c04160458dee4c83
Author: Craig L Russell <craig.russell@oracle.com>
AuthorDate: Tue Jan 30 20:02:31 2018 -0800

    project/icla add roughed-in vote processing
---
 www/project/icla/Gemfile                    |  1 +
 www/project/icla/views/actions/vote.json.rb | 19 +++++++++++++++++--
 www/project/icla/views/pages/invite.js.rb   |  2 ++
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/www/project/icla/Gemfile b/www/project/icla/Gemfile
index b66a033..ba7c1a9 100644
--- a/www/project/icla/Gemfile
+++ b/www/project/icla/Gemfile
@@ -11,6 +11,7 @@ else
   gem 'whimsy-asf'
 end
 
+gem 'mail'
 gem 'rake'
 gem 'wunderbar', '>= 1.2.6'
 gem 'ruby2js'
diff --git a/www/project/icla/views/actions/vote.json.rb b/www/project/icla/views/actions/vote.json.rb
index f1618af..658c5ba 100644
--- a/www/project/icla/views/actions/vote.json.rb
+++ b/www/project/icla/views/actions/vote.json.rb
@@ -2,6 +2,7 @@ require 'socket'
 require 'net/http'
 require 'pathname'
 require 'json'
+require 'mail'
 
 # find pmc and user information
 # all ppmcs are also pmcs but not all pmcs are ppmcs
@@ -9,8 +10,8 @@ require 'json'
 pmc = ASF::Committee.find(@pmc)
 ppmc = ASF::Podling.find(@pmc)
 pmc_type = if ppmc and ppmc.status == 'current' then 'PPMC' else 'PMC' end
-
 user = ASF::Person.find(env.user)
+useremail = user.id + '@apache.org'
 
 
 begin
@@ -45,7 +46,6 @@ discussion_json = discussion.to_json
 file_name = '/srv/icla/' + token + '.json'
 File.open(file_name.untaint, 'w') {|f|f.write(discussion_json)}
 
-# create the email to the pmc
 
 # add user and pmc emails to the response
 _userEmail "#{user.public_name} <#{user.mail.first}>" if user
@@ -55,6 +55,21 @@ path = Pathname.new(env['REQUEST_URI']) + "../../?token=#{token}"
 scheme = env['rack.url_scheme'] || 'https'
 link = "#{scheme}://#{env['HTTP_HOST']}#{path}"
 
+# create the email to the pmc
+mail = Mail.new do
+  to useremail
+  from useremail
+  subject @subject
+  text_part do
+    body %{#{comment}
+    Use this link to vote:
+
+    #{link}
+    }
+  end
+end
+mail.deliver
+
 # add token and invitation to the response
 _token token
 _subject params['subject']
diff --git a/www/project/icla/views/pages/invite.js.rb b/www/project/icla/views/pages/invite.js.rb
index d357799..7818e5f 100644
--- a/www/project/icla/views/pages/invite.js.rb
+++ b/www/project/icla/views/pages/invite.js.rb
@@ -19,6 +19,7 @@ class Invite < Vue
     @phasePrefix = ''
     @member = Server.data.member
     @pmc_mail = Server.data.pmc_mail
+    @user = Server.data.user
 
 # initialize conditional text
     @showPMCVoteLink = false;
@@ -592,6 +593,7 @@ class Invite < Vue
   end
   def previewVote()
     data = {
+      user: @user,
       iclaname: @iclaname,
       iclaemail: @iclaemail,
       pmc: @pmc,

-- 
To stop receiving notification emails like this one, please contact
clr@apache.org.

Mime
View raw message