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 12, 2024
1 parent 1927f05 commit 15ed6cb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions classes/log/SubmissionEmailLogEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class SubmissionEmailLogEntry extends EmailLogEntry
public const SUBMISSION_EMAIL_REVIEW_CONFIRM = 0x40000005;
public const SUBMISSION_EMAIL_REVIEW_DECLINE = 0x40000006;
public const SUBMISSION_EMAIL_REVIEW_CONFIRM_ACK = 0x40000008;
public const SUBMISSION_EMAIL_REVIEW_REQUEST = 0x40000009;
public const SUBMISSION_EMAIL_REVIEW_REQUEST_SUBSEQUENT = 0x4000000A;

// Copyeditor events 0x50000000
public const SUBMISSION_EMAIL_COPYEDIT_NOTIFY_COPYEDITOR = 0x50000001;
Expand Down
9 changes: 9 additions & 0 deletions classes/submission/action/EditorAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
use PKP\core\PKPString;
use PKP\db\DAORegistry;
use PKP\log\event\PKPSubmissionEventLogEntry;
use PKP\log\SubmissionEmailLogDAO;
use PKP\log\SubmissionEmailLogEntry;
use PKP\mail\mailables\ReviewRequest;
use PKP\mail\mailables\ReviewRequestSubsequent;
use PKP\mail\variables\ReviewAssignmentEmailVariable;
Expand Down Expand Up @@ -137,6 +139,13 @@ public function addReviewer($request, $submission, $reviewerId, &$reviewRound, $

try {
Mail::send($mailable);

/** @var SubmissionEmailLogDAO $submissionEmailLogDao */
$submissionEmailLogDao = DAORegistry::getDAO('SubmissionEmailLogDAO');
$submissionEmailLogDao->logMailable(
$round === ReviewRound::REVIEW_ROUND_STATUS_REVISIONS_REQUESTED
? SubmissionEmailLogEntry::SUBMISSION_EMAIL_REVIEW_REQUEST
: SubmissionEmailLogEntry::SUBMISSION_EMAIL_REVIEW_REQUEST_SUBSEQUENT, $mailable, $submission, $user);
} catch (TransportException $e) {
$notificationMgr = new PKPNotificationManager();
$notificationMgr->createTrivialNotification(
Expand Down
6 changes: 6 additions & 0 deletions controllers/grid/users/reviewer/form/ReviewReminderForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
use PKP\facades\Locale;
use PKP\form\Form;
use PKP\log\event\PKPSubmissionEventLogEntry;
use PKP\log\SubmissionEmailLogDAO;
use PKP\log\SubmissionEmailLogEntry;
use PKP\mail\mailables\ReviewRemind;
use PKP\mail\variables\ReviewAssignmentEmailVariable;
use PKP\notification\PKPNotification;
Expand Down Expand Up @@ -173,6 +175,10 @@ public function execute(...$functionArgs)
$reviewAssignment->stampModified();
$reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO'); /** @var ReviewAssignmentDAO $reviewAssignmentDao */
$reviewAssignmentDao->updateObject($reviewAssignment);

/** @var SubmissionEmailLogDAO $submissionEmailLogDao */
$submissionEmailLogDao = DAORegistry::getDAO('SubmissionEmailLogDAO');
$submissionEmailLogDao->logMailable(SubmissionEmailLogEntry::SUBMISSION_EMAIL_REVIEW_REMIND, $mailable, $submission, $user);
} catch (TransportException $e) {
$notificationMgr = new NotificationManager();
$notificationMgr->createTrivialNotification(
Expand Down

0 comments on commit 15ed6cb

Please sign in to comment.