Different review request mail for one user

We are installing OJS 3.1.1.4, including our own theme. The theme is working.

Our workflow has a twist that is not supported directly. When an editor decides that an article probably should be accepted, they send an email to an editors-only mailing list to initiate a discussion there. The email contains a form letter plus author/title/abstract.

In 2.4.8, we did this via a special user, say “mailing-list”, whose email address is the address of the mailing list. Editors would select this user as an additional reviewer. Some code added to classes/submission/sectionEditor/SectionEditorAction.inc.php caught this special username and used a different prepared email ‘NOTIFY_EDITORS’ in place of the usual one (REVIEW_REQUEST or REVIEW_REQUEST_ONECLICK). That worked pretty well.

I’m trying to do the same in 3.1.1.4 but so far without success. I copied lib/pkp/controllers/grid/users/reviewer/form/ReviewerForm.inc.php to our theme and in function initData() I added three lines:

$context = $request->getContext();
$templateKey = $this->_getMailTemplateKey($context);

// BDM added: different template for mailing list
if ($reviewerId->getUsername() == ‘mailing-list’) {
$templateKey = ‘NOTIFY_EDITORS’;
}

$template = new SubmissionMailTemplate($submission, $templateKey);

I don’t see any errors in the php log, but the special email template is not selected. I checked that the special user and email template are present. The email selected is the usual review request form, not NOTIFY_EDITORS.

I suspect I’m doing it all wrong. Is it the right file and the right function?

Thanks, Brendan.

I guess I can’t theme the backend so simply, but I’ll ignore that issue and edit the original file for now.

$reviewerId->getUsername() should be $reviewer->getUsername() but that doesn’t help as $reviewer is null just here. I tried a few other possibilities in this file without success.

Please help. Brendan.