OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



authors param for email?

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

authors param for email?

Postby theodore » Tue Aug 07, 2012 4:05 pm

I want to make custom email to be sent by completing submission article, that shows to the editor the article name along with all the authors names and emails of the article.
the $authorName param presents the author who submitted the article, even if he hasn't included himself as author of the article.

What is the correct param to appear all the authors nams and emails of an article?
theodore
 
Posts: 37
Joined: Wed May 16, 2012 8:52 am

Re: authors param for email?

Postby theodore » Wed Aug 08, 2012 3:27 pm

I finally made it.

For al the authors to appear, there is already param as $authorString, which returns a string with all the authors names for the article submitted.
For the authors' mails, I needed to create new function in the "submission.inc.php" as follows:

/**
* Return a STRING of ALL authors email addresses.
* @return string
* @by Kaligator87
*/
function getAuthorEmailString($lastOnly = false, $separator = ', ') {
import('lib.pkp.classes.mail.Mail');
$strM = '';
foreach ($this->authors as $a) {
if (!empty($strM)) {
$strM .= $separator;
}
$strM .= $lastOnly ? $a->getLastName() : $a->getEmail();
}
return $strM;
}

then, in the "ArticleMailTemplate.inc.php", I just add the following line assignParams function:
$paramArray['authorEmailString'] = strip_tags($article->getAuthorEmailString());

Now, I have created new param as $AuthorEmailString which returns a string with the authors' mails in custom or edited prepared mail.

I hope I did not forget anything to my explanation.

cheers!
theo
theodore
 
Posts: 37
Joined: Wed May 16, 2012 8:52 am


Return to OJS Development

Who is online

Users browsing this forum: No registered users and 2 guests