Moderators: jmacgreg, michael, John, vgabler
debmallett wrote:We are one journal on a server that hosts other journals, so I don't think I have access to do any coding. If any of this does involve coding, I could ask our hosts.
/**
* Notifies the editor that a revision has been submitted
* @param $submission object
* @param $articleId int
* @param $send boolean
* @return boolean true if ready for redirect
*/
function mailEditorRevisionNotification($submission, $articleId, $send = false) {
// Get the Article DAO because we need to access article info from the db
import('classes.article.ArticleDAO');
$articleDao = & DAORegistry::getDAO('ArticleDAO');
// Use the article DAO to get the article object for the specific article id.
$article = $articleDao->getArticle($articleId);
// Get the email template class since we're accessing email functions
import('classes.mail.ArticleMailTemplate');
$myEmailTemplateName = 'NEW_REVISIONS_SUBMITTED'; // Whatever your email template name is
$email = new ArticleMailTemplate($submission, $myEmailTemplateName);
// A bit of safety. If the article ID we're given matches with the article ID of the submission, send the email
if ($articleId == $submission->getArticleId()) {
if ($email->isEnabled()) { // Making sure emailing is enabled on the install
$email->toAssignedEditors($articleId); // Send this email to the assigned editors
$email->toAssignedEditingSectionEditors($articleId); // And include the section editors
// This is where you'll assign any custom variables you want in your template
$paramArray = array(
'articleTitle' => strip_tags($article->getLocalizedTitle()), // {$articleTitle} in your template
'articleId' => $article->getId(), // {$articleId} in your template
);
$email->assignParams($paramArray); // Adds them to the email template
$email->send(); // Sends the email
}
return true;
}
}
/**
* Author revision email
* @param $authorSubmission object
*/
function mailEditorRevisionNotification($args) {
// Make sure we have an article id
$articleId = isset($args[0]) ? $args[0] : 0;
$this->validate($articleId);
// Have the PKP engine get the page template going
$this->setupTemplate(true, $articleId);
$journal =& Request::getJournal();
$user =& Request::getUser();
$submission =& $this->submission;
$this->setupTemplate(true, $articleId, 'review');
// Call the action for sending the email
if (AuthorAction::mailEditorRevisionNotification($submission, $articleId, $send)) {
// If the action returns true then redirect to the article's submission review page
Request::redirect(null, null, 'submissionReview', $articleId);
}
}
Return to OJS Editorial Support and Discussion
Users browsing this forum: No registered users and 3 guests