Page MenuHomePhabricator

Notify coordinators of new applications
Closed, ResolvedPublic

Description

When there is a new application at The Library Card Platform, the coordinator who is responsible for reviewing the applicants should get a notification, possibly through email.

Event Timeline

Stryn created this task.Mar 30 2017, 5:11 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 30 2017, 5:11 PM
Samwalton9 triaged this task as Medium priority.
Samwalton9 removed jsn.sherman as the assignee of this task.Oct 13 2017, 12:23 PM
Samwalton9 added a subscriber: jsn.sherman.
Samwalton9 raised the priority of this task from Medium to High.Oct 13 2017, 12:47 PM
Samwalton9 lowered the priority of this task from High to Medium.Dec 19 2017, 5:44 PM

We could do this an email per application, but that could get heavy for some partners. There are then degrees of complexity all the way up to irregular updates based on age of each application and number of applications open. We should discuss how complex we need this to be and what the best compromise between those extremes is.

Samwalton9 raised the priority of this task from Medium to High.Jan 8 2018, 6:28 PM
  • Weekly email, sent to the designated coordinator, directing them to applications that are pending, if there are any.
  • Bonus: a count of pending applications

And don't send if 0 applications pending.

Quick update on this. Completed bits:

  • Got the management command that will be run as a cron task properly sending a signal when it's called and email task code is properly receiving that signal.
  • Got the command to use the existing code paths to get the list of apps that we want to send notifications about, so that this new custom signal works basically the same way as the builtin signals we were already using to trigger notifications.

At this point, I've covered all of the bits that are unique to the time-based trigger for sending emails within the platform itself, basically the things I didn't already know how to do. The rest will be straightforward as it will work the same way as the existing notifications.

Todo:

  • I need to write up the djmail task to actually parse the app data to send the template based emails.
  • I need to write the mail templates for the notification content.
  • If we want @Nikkimaria to get notifications about pending apps, then please set her as the coordinator for the partners that don't have one. It might make sense for that to be a required field moving forward. That's a trivial change for me to make, but we need to make sure that field is populated for all partners before I bring the change to production.

I have everything pretty well wired up in my feature branch. Current email looks like:

Content-Type: multipart/alternative;
 boundary="===============9004739030318065501=="
MIME-Version: 1.0
Subject: 8 Wikipedia Library applications are awaiting your review
From: <twlight.local@localhost.localdomain>
To: ***@***.***
Date: Thu, 25 Jan 2018 20:46:28 -0000
Message-ID: <20180125204628.13800.25159@debian-8.7-amd64>

--===============9004739030318065501==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit





Our records indicate that you are the designated coordinator for partners that have a total of 8 applications with a status of PENDING. This is a gentle reminder that you may review applications at https://wikipedialibrary.wmflabs.org/applications/list/. If you received this message in error, drop us a line at wikipedialibrary@wikimedia.org. Thanks for helping review Wikipedia Library applications!

--===============9004739030318065501==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 7bit





Our records indicate that you are the designated coordinator for partners that have a total of 8 applications with a status of PENDING. This is a gentle reminder that you may review applications at https://wikipedialibrary.wmflabs.org/applications/list/. If you received this message in error, drop us a line at wikipedialibrary@wikimedia.org. Thanks for helping review Wikipedia Library applications!

--===============9004739030318065501==--

-------------------------------------------------------------------------------

@Samwalton9 and @Nikkimaria just let me know once all of the partners have a coordinator set. I'll then be able to push the changes to the live site.

If we want @Nikkimaria to get notifications about pending apps, then please set her as the coordinator for the partners that don't have one. It might make sense for that to be a required field moving forward. That's a trivial change for me to make, but we need to make sure that field is populated for all partners before I bring the change to production.

Is it not possible to just avoid those partners with no set coordinator? The current default message includes a link to join the team, which I'd rather keep.

@Samwalton9 absolutely. We can just not send emails on those, if @Nikkimaria doesn't need notifications.

Hm. I've added myself as coordinator, but I don't need emails, so I'm quite fine with undoing that if it's possible to just skip those partners without a coordinator listed.

@Nikkimaria Yep, I'll get things pushed to the master branch this evening or early tomorrow morning. Go ahead an undo the change. Sorry for the confusion on this, all.

I've slightly updated the message template and pushed the code to production. I also fired off the task manually since it's Monday. As a sidenote, admins can view the emails we've sent under the "messages" section of the administration page.

Samwalton9 closed this task as Resolved.Jan 30 2018, 2:05 PM
Samwalton9 claimed this task.

Will be opening a couple of tasks to expand on this functionality.