-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Task/nudge reviewer invitations (#865)
* Add Send Reminders link/email to reviewer invitations * Move get_login_url_by_email_address to helper method * Add specs
- Loading branch information
Showing
13 changed files
with
149 additions
and
29 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
app/controllers/grant_reviewers/invitations/reminders_controller.rb
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,29 @@ | ||
module GrantReviewers | ||
module Invitations | ||
class RemindersController < InvitationsController | ||
def index | ||
authorize @grant, :edit? | ||
@open_invitations = GrantReviewer::Invitation | ||
.with_inviter | ||
.where(grant_id: @grant.id) | ||
.open | ||
if @open_invitations.any? | ||
send_reminder_emails | ||
flash[:notice] = 'Reminder emails have been sent to those who have not yet responded.' | ||
else | ||
flash[:warning] = 'There are no open reviewer invitations for this grant. No reminders have been sent' | ||
end | ||
redirect_to grant_invitations_path(@grant) | ||
end | ||
|
||
private | ||
|
||
def send_reminder_emails | ||
@open_invitations.each do |invitation| | ||
GrantReviewerInvitationMailer.reminder(invitation: invitation, grant: @grant).deliver_now | ||
invitation.update(reminded_at: Time.now) | ||
end | ||
end | ||
end | ||
end | ||
end |
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
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
15 changes: 15 additions & 0 deletions
15
app/views/grant_reviewer_invitation_mailer/reminder.html.haml
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,15 @@ | ||
%p | ||
This is a friendly reminder that you have been invited by #{full_name(@inviter)} to be a reviewer for | ||
%br | ||
#{@grant.name} | ||
%br | ||
a grant in #{link_to COMPETITIONS_CONFIG[:application_name], get_login_url_by_email_address(@email)}. | ||
|
||
%p | ||
Once you have logged in, you may also opt out of this request. | ||
|
||
%p | ||
If you have questions, you can contact #{full_name(@inviter)} at #{@inviter.email}. | ||
|
||
%p | ||
Thank you. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
en: | ||
mailers: | ||
grant_reviewer_invitations: | ||
invite: | ||
subject: "Reviewer Invitation for %{grant}" | ||
reminder: | ||
subject: "Reminder - Reviewer Invitation for %{grant}" |
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
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