-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fc_1786_2_av
- Loading branch information
Showing
7 changed files
with
101 additions
and
36 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,6 +89,14 @@ def batch_processing_success(message, user, batch) | |
adjust_email_recipients(subject) | ||
end | ||
|
||
def communicate_github_issue_creation(feedback) | ||
@feedback = feedback | ||
@user = UseridDetail.where(userid: feedback.user_id).first | ||
@user_email = @user.email_address | ||
mail(to: @user_email, :subject => 'Notification of github issue creation') | ||
end | ||
|
||
|
||
def contact_action_request(contact, send_to, copies_to) | ||
@appname = appname | ||
@contact = contact | ||
|
@@ -123,7 +131,7 @@ def coordinator_contact_reply(contact, ccs_userids, message, sender_userid) | |
|
||
def coordinator_feedback_reply(feedback, ccs_userids, message, sender_userid) | ||
@appname = appname | ||
@feedback = feedback | ||
@feedback = feedbackappname | ||
@message = message | ||
@cc_email_addresses = get_email_address_array_from_array_of_userids(ccs_userids) | ||
sender_email_address = get_email_address_from_userid(sender_userid) | ||
|
@@ -522,9 +530,11 @@ def send_logs(file, ccs, body_message, subjects) | |
def send_upload_stats(start_date, end_date) | ||
@start_date = start_date | ||
@end_date = end_date | ||
@uploaders_count, @email_confirmed, @users_count = PhysicalFile.new.upload_report_mail(@start_date, @end_date) | ||
@uploaders_count, @email_confirmed, @users_count, @records_added = PhysicalFile.new.upload_report_mail(@start_date, @end_date) | ||
@transcribers_count, @active_transcribers_count, @email_confimed = UseridDetail.get_transcriber_stats(@start_date, @end_date) | ||
mail(from: "[email protected]", to: 'Denise Colbert <[email protected]>',cc: 'Vinodhini Subbu <[email protected]>', subject: "Upload report stats") | ||
from_email = "no-reply@#{appname.downcase}.org.uk" | ||
to_email, cc_email = app_specific_email_upload_stats | ||
mail(from: from_email, to: to_email, cc: cc_email, subject: "Upload report stats") | ||
end | ||
|
||
def embargo_process_completion_email(rule_id, ccs) | ||
|
@@ -569,6 +579,20 @@ def adjust_email_recipients(message) | |
end | ||
end | ||
|
||
def app_specific_email_upload_stats | ||
to_email = '' | ||
cc_email = '' | ||
case appname.downcase | ||
when 'freereg' | ||
to_email = '[email protected]' | ||
cc_email = "[email protected]" | ||
when 'freecen' | ||
to_email = '[email protected]' | ||
cc_email = "[email protected]" | ||
end | ||
[to_email, cc_email] | ||
end | ||
|
||
def get_email_address_array_from_array_of_userids(userids) | ||
array_of_email_addresses = [] | ||
if userids.present? | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
app/views/user_mailer/communicate_github_issue_creation.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<p>Dear <%= @user.userid%></p> | ||
<p>You had submitted some feedback to <%= @appname %> reference | ||
<a href="<%=Rails.application.config.website%>/feedbacks/<%=@feedback.id%>"><%= @feedback.identifier %></a> | ||
to us with the title <b><%= @feedback.title%></b> at <%= @feedback.feedback_time.strftime("%H:%M on %F") unless @feedback.feedback_time.nil?%></p> | ||
<p>This email is to notify you that we have created an github issue and you can monitor the progess here: <%= link_to "link to github issue", @feedback.github_issue_url %></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,36 @@ | ||
<html> | ||
<p>Hello Everyone,</p> | ||
<p>Please find the upload report for the month of <%= @start_date.strftime('%B')%></p> | ||
<p>Here is the upload report for the month of <%= @start_date.strftime('%B')%></p> | ||
<div class="scrollable"> | ||
<table style="border: 1px solid black;"> | ||
<caption> | ||
<strong>Basic information</strong> | ||
<strong><p>Upload report by members</p></strong> | ||
</caption> | ||
<thead> | ||
<tr> | ||
<th scope="col" style="border: 1px solid black;">Detail</th> | ||
<th scope="col" style="border: 1px solid black;">Count</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<th scope="row" style="border: 1px solid black;">Total active transcribers</th> | ||
<td style="border: 1px solid black;"><%= @active_transcribers_count %></td> | ||
</tr> | ||
<tr> | ||
<th style="border: 1px solid black; padding: 5px;">Time Period</th> | ||
<th style="border: 1px solid black; padding: 5px;">Roles</th> | ||
<th style="border: 1px solid black; padding: 5px">Upload Count</th> | ||
</tr> | ||
<% @uploaders_count.each do |u| %> | ||
<tr> | ||
<th scope="row" style="border: 1px solid black;">Number of transcribers with their email address confirmed in this period.</th> | ||
<td style="border: 1px solid black;"><%= @email_confimed %></td> | ||
<td style="border: 1px solid black; padding: 5px;"><%= "#{@start_date.to_date.strftime("%B, %d, %Y")} - #{@end_date.to_date.strftime("%B, %d, %Y")}" %></td> | ||
<td style="border: 1px solid black; padding: 5px;"> | ||
<%= u[0].split('_').map(&:titlecase).join(' ') %> | ||
</td> | ||
<td style="border: 1px solid black; padding: 5px;"><%= u[1] %></td> | ||
</tr> | ||
</tbody> | ||
<% end %> | ||
</table> | ||
</div> | ||
|
||
<div class="scrollable"> | ||
<table style="border: 1px solid black;"> | ||
<caption> | ||
<strong><p>Upload report by members</p></strong> | ||
<strong><p>Database Additions</p></strong> | ||
</caption> | ||
<tr> | ||
<th style="border: 1px solid black;">Time Period</th> | ||
<th style="border: 1px solid black;">Roles</th> | ||
<th style="border: 1px solid black;">Upload Count</th> | ||
<th style="border: 1px solid black; padding: 5px;">New Records added</th> | ||
<td style="border: 1px solid black; padding: 5px;"><%= number_with_delimiter(@records_added) %></td> | ||
</tr> | ||
<% @uploaders_count.each do |u| %> | ||
<tr> | ||
<td style="border: 1px solid black;"><%= "#{@start_date.to_date.strftime("%B, %d, %Y")} - #{@end_date.to_date.strftime("%B, %d, %Y")}" %></td> | ||
<td style="border: 1px solid black;"> | ||
<%= u[0].split('_').map(&:titlecase).join(' ') %> | ||
</td> | ||
<td style="border: 1px solid black;"><%= u[1] %></td> | ||
</tr> | ||
<% end %> | ||
</table> | ||
</div> | ||
</html> |