From ac5f792629d00cdc2b4f9af832144c705af31edd Mon Sep 17 00:00:00 2001 From: Taslan Graham Date: Wed, 11 Sep 2024 18:21:50 -0500 Subject: [PATCH] pkp/pkp-lib#9991 log review request/reminder emails --- classes/log/SubmissionEmailLogEventType.php | 2 ++ classes/submission/action/EditorAction.php | 10 ++++++++++ .../grid/users/reviewer/form/ReviewReminderForm.php | 3 +++ 3 files changed, 15 insertions(+) diff --git a/classes/log/SubmissionEmailLogEventType.php b/classes/log/SubmissionEmailLogEventType.php index bae48ce77f9..f3e7cc423de 100644 --- a/classes/log/SubmissionEmailLogEventType.php +++ b/classes/log/SubmissionEmailLogEventType.php @@ -39,6 +39,8 @@ enum SubmissionEmailLogEventType: int implements EmailLogEventType case REVIEW_CONFIRM = 0x40000005; case REVIEW_DECLINE = 0x40000006; case REVIEW_CONFIRM_ACK = 0x40000008; + case REVIEW_REQUEST = 0x40000009; + case REVIEW_REQUEST_SUBSEQUENT = 0x4000000A; // Copyeditor events 0x50000000 case COPYEDIT_NOTIFY_COPYEDITOR = 0x50000001; diff --git a/classes/submission/action/EditorAction.php b/classes/submission/action/EditorAction.php index 860adafe549..1acf71a0dbd 100644 --- a/classes/submission/action/EditorAction.php +++ b/classes/submission/action/EditorAction.php @@ -27,6 +27,7 @@ use PKP\db\DAORegistry; use PKP\invitation\invitations\ReviewerAccessInvite; use PKP\log\event\PKPSubmissionEventLogEntry; +use PKP\log\SubmissionEmailLogEventType; use PKP\mail\mailables\ReviewRequest; use PKP\mail\mailables\ReviewRequestSubsequent; use PKP\notification\Notification; @@ -143,6 +144,15 @@ public function addReviewer($request, $submission, $reviewerId, &$reviewRound, $ try { Mail::send($mailable); + + Repo::emailLogEntry()->logMailable( + $round === ReviewRound::REVIEW_ROUND_STATUS_REVISIONS_REQUESTED + ? SubmissionEmailLogEventType::REVIEW_REQUEST + : SubmissionEmailLogEventType::REVIEW_REQUEST_SUBSEQUENT, + $mailable, + $submission, + $user + ); } catch (TransportException $e) { $notificationMgr = new PKPNotificationManager(); $notificationMgr->createTrivialNotification( diff --git a/controllers/grid/users/reviewer/form/ReviewReminderForm.php b/controllers/grid/users/reviewer/form/ReviewReminderForm.php index da646b65f04..70c100eee6b 100644 --- a/controllers/grid/users/reviewer/form/ReviewReminderForm.php +++ b/controllers/grid/users/reviewer/form/ReviewReminderForm.php @@ -26,6 +26,7 @@ use PKP\facades\Locale; use PKP\form\Form; use PKP\log\event\PKPSubmissionEventLogEntry; +use PKP\log\SubmissionEmailLogEventType; use PKP\mail\mailables\ReviewRemind; use PKP\mail\variables\ReviewAssignmentEmailVariable; use PKP\notification\Notification; @@ -167,6 +168,8 @@ public function execute(...$functionArgs) ]); Repo::eventLog()->add($eventLog); + Repo::emailLogEntry()->logMailable(SubmissionEmailLogEventType::REVIEW_REMIND, $mailable, $submission, $user); + Repo::reviewAssignment()->edit($reviewAssignment, [ 'dateReminded' => Core::getCurrentDate(), ]);