Skip to content

Commit

Permalink
pkp#9991 log review request/reminder emails
Browse files Browse the repository at this point in the history
  • Loading branch information
taslangraham committed Sep 26, 2024
1 parent 2c5d205 commit 26e46ac
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions classes/log/SubmissionEmailLogEventType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions classes/submission/action/EditorAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(
Expand Down
3 changes: 3 additions & 0 deletions controllers/grid/users/reviewer/form/ReviewReminderForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(),
]);
Expand Down

0 comments on commit 26e46ac

Please sign in to comment.