Insert metadata os step 1 in email

Hi.

I would like to add a metadata variable from step 1 in one of the emails.

How I can insert variables in emails?

Thank you

José

Hi @josegovia,

Do you mean step 1 of setup, or step 1 of the submission process, and what field? Which email template do you want to put it into?

What software of ours are you using, and what version?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec.

It´s in the STEP 1 of the Submission Process.

The field is the Comments to Editor.

The email template is REVIEW REQUEST, SUBMISSION ACK.

Thanks

Hi @josegovia,

I assume you’re using OJS? What version?

Regards,
Alec Smecher
Public Knowledge Project Team

Sorry.

It´s OJS version 2.4.6.0

José

Hi @josegovia,

For each email, you’ll need to find where it’s coded. You can do this by searching the codebase for the email key. For example, on my Linux system, I can run…

find . -name *.inc.php -exec fgrep -l REVIEW_REQUEST “{}” “;”

This gives me

classes/tasks/ReviewReminder.inc.php
classes/submission/sectionEditor/SectionEditorAction.inc.php

The first is for REVIEW_REQUEST_REMIND_AUTO, not REVIEW_REQUEST, so we can ignore it.

The second has the email template loaded here:

$emailTemplate = 'REVIEW_REQUEST';
(...snip...)
$email = new ArticleMailTemplate($sectionEditorSubmission, $emailTemplate, null, $isEmailBasedReview?true:null);

The variables are assigned further down:

$paramArray = array(
    'reviewerName' => $reviewer->getFullName(),
    (...snip...)
);
$email->assignParams($paramArray);

You can add new variables to $paramArray to make them available to the email template. The value you’re looking for can be fetched using $sectionEditorSubmission->getCommentsToEditor().

Regards,
Alec Smecher
Public Knowledge Project Team