pkp-lib
pkp-lib copied to clipboard
[OJS 3.4] Reviewer invitation email not available anymore in Submission Activity Logs
Describe the bug When inviting a new user to review a submission, a new entry with a copy of the email sent used to be added in the submission Activity Logs. Starting with 3.4, this is no longer the case. This is a major problem if the configuration "One-click Reviewer Access" is used as the Activity Logs emails copy was the only place editors can get the one click URL sent to the reviewer.
To Reproduce Steps to reproduce the behavior:
- Go to a submission at the Review Stage
- Invite a new reviewer to the submission (Add reviewer button)
- In the invitation window, ensure that the option "Do not send email to Reviewer." is unchecked
- Confirm by clicking on the Add reviewer button
- Got the the activtiy log (clic on the Activity log Button on the top left of the page)
- In the activity log window, the email sent to the reviewer is not available. It only contains an entry confirming the invitation of the reviewer.
The line that used to be in the Activity Log for reviewer invitation email was the following one :
What application are you using? OJS 3.4.0.4 also tested on 3.4.0.5
The editors intentionally shouldn't be able to get the one-click emails -- in previous releases this was intentionally prevented. We'll be using more invitation tools in the future that similarly will be designed to avoid letting the editor fully "impersonate" the user without some kind of indication that's what happened. Can you describe your use case a little more?
Hi,
I have a similar issue after upgrading fron 3.3.0-14 to 3.4.0-5. Email text log is not registered on Activity history on 3.4 version.
Even when the email is correctly sent, the email text log is not registered on activity history. Is this a new behavior on 3.4 version or is this an issue?
@Vitaliy-1, could you have a look at this one?
We have exactly the same situation. When a reviewer is assigned, they receive the e-mail invitation, but email does not show up in the activity log. When I send an individual email to the reviewer as editor, we can see the email history in the activity log.
We are using OJS 3.4.0.5.
Is there any possibility to solve this problem before the new version is released?
We later realised that the subject of the OJS e-mail subject was too long. It automatically contains the title and subtitle of the submission as well as other information. The limit for the e-mail subject was set to 255, we changed it to 988 and now it's fine.
On which table did you make this change?
I made changes to table 'email_log'. More details in #10020
I made changes to table 'email_log'. More details in #10020
This method did not solve my problem.
When a reviewer is assigned, they receive the email invitation, but the email does not appear in the activity log.
this is a same issue I think https://github.com/pkp/pkp-lib/issues/9991
@Vitaliy-1 Thank you for the sharing the files path.
I have added functionality to log email data for the "Add Reviewer" action in OJS 3.4. Below are the changes made:
Files Modified lib/pkp/classes/log/event/PKPSubmissionEventLogEntry.php lib/pkp/classes/submission/action/EditorAction.php
Changes
- lib/pkp/classes/log/event/PKPSubmissionEventLogEntry.php
Added new constants for email events:
`class PKPSubmissionEventLogEntry extends EventLogEntry { // ... existing constants ...
public const SUBMISSION_EMAIL_REVIEW_REQUEST = 0x50000001;
public const SUBMISSION_EMAIL_REVIEW_REQUEST_SUBSEQUENT = 0x50000002;
// ... existing methods ...
} ` 2. lib/pkp/classes/submission/action/EditorAction.php
Modified the addReviewer method to include email logging:
`public function addReviewer($request, $submission, $reviewerId, &$reviewRound, $reviewDueDate, $responseDueDate, $reviewMethod = null) { // ... existing code ...
if (!$assigned && isset($reviewer) && !Hook::call('EditorAction::addReviewer', [&$submission, $reviewerId])) {
// ... existing code ...
// Send mail
if (!$request->getUserVar('skipEmail')) {
$context = PKPServices::get('context')->get($submission->getData('contextId'));
$emailTemplate = Repo::emailTemplate()->getByKey($submission->getData('contextId'), $request->getUserVar('template'));
$emailBody = $request->getUserVar('personalMessage');
$emailSubject = $emailTemplate->getLocalizedData('subject');
$mailable = $this->createMail($submission, $reviewAssignment, $reviewer, $user, $emailBody, $emailSubject, $context);
try {
Mail::send($mailable);
// Log email
$eventType = ($reviewRound->getRound() == 1) ? PKPSubmissionEventLogEntry::SUBMISSION_EMAIL_REVIEW_REQUEST : PKPSubmissionEventLogEntry::SUBMISSION_EMAIL_REVIEW_REQUEST_SUBSEQUENT;
$submissionEmailLogDao = DAORegistry::getDAO('SubmissionEmailLogDAO');
$submissionEmailLogDao->logMailable($eventType, $mailable, $submission, $user);
} catch (TransportException $e) {
$notificationMgr = new PKPNotificationManager();
$notificationMgr->createTrivialNotification(
$user->getId(),
PKPNotification::NOTIFICATION_TYPE_ERROR,
['contents' => __('email.compose.error')]
);
trigger_error('Failed to send email: ' . $e->getMessage(), E_USER_WARNING);
}
}
}
}
Summary
These changes ensure that email data is logged whenever a reviewer is added.`
Thanks @jim13731 These changes solved my problem.
Hi @jim13731! Would you be able to open a pull request proposing those changes, and link add a link to the pull request here? That way we can review it for possible inclusion in the next release.