本文整理汇总了PHP中ArticleMailTemplate::setSubject方法的典型用法代码示例。如果您正苦于以下问题:PHP ArticleMailTemplate::setSubject方法的具体用法?PHP ArticleMailTemplate::setSubject怎么用?PHP ArticleMailTemplate::setSubject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArticleMailTemplate
的用法示例。
在下文中一共展示了ArticleMailTemplate::setSubject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendReminder
function sendReminder($reviewAssignment, $article, $journal)
{
$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
$userDao =& DAORegistry::getDAO('UserDAO');
$reviewId = $reviewAssignment->getId();
$reviewer =& $userDao->getUser($reviewAssignment->getReviewerId());
if (!isset($reviewer)) {
return false;
}
import('mail.ArticleMailTemplate');
$reviewerAccessKeysEnabled = $journal->getSetting('reviewerAccessKeysEnabled');
$email = new ArticleMailTemplate($article, $reviewerAccessKeysEnabled ? 'REVIEW_REMIND_AUTO_ONECLICK' : 'REVIEW_REMIND_AUTO', null, false, $journal);
$email->setJournal($journal);
$email->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
$email->addRecipient($reviewer->getEmail(), $reviewer->getFullName());
$email->setAssoc(ARTICLE_EMAIL_REVIEW_REMIND, ARTICLE_EMAIL_TYPE_REVIEW, $reviewId);
$email->setSubject($email->getSubject($journal->getPrimaryLocale()));
$email->setBody($email->getBody($journal->getPrimaryLocale()));
$urlParams = array();
if ($reviewerAccessKeysEnabled) {
import('security.AccessKeyManager');
$accessKeyManager = new AccessKeyManager();
// Key lifetime is the typical review period plus four weeks
$keyLifetime = ($journal->getSetting('numWeeksPerReview') + 4) * 7;
$urlParams['key'] = $accessKeyManager->createKey('ReviewerContext', $reviewer->getId(), $reviewId, $keyLifetime);
}
$submissionReviewUrl = Request::url($journal->getPath(), 'reviewer', 'submission', $reviewId, $urlParams);
$paramArray = array('reviewerName' => $reviewer->getFullName(), 'reviewerUsername' => $reviewer->getUsername(), 'journalUrl' => $journal->getUrl(), 'reviewerPassword' => $reviewer->getPassword(), 'reviewDueDate' => strftime(Config::getVar('general', 'date_format_short'), strtotime($reviewAssignment->getDateDue())), 'weekLaterDate' => strftime(Config::getVar('general', 'date_format_short'), strtotime('+1 week')), 'editorialContactSignature' => $journal->getSetting('contactName') . "\n" . $journal->getLocalizedTitle(), 'passwordResetUrl' => Request::url($journal->getPath(), 'login', 'resetPassword', $reviewer->getUsername(), array('confirm' => Validation::generatePasswordResetHash($reviewer->getId()))), 'submissionReviewUrl' => $submissionReviewUrl);
$email->assignParams($paramArray);
$email->send();
$reviewAssignment->setDateReminded(Core::getCurrentDate());
$reviewAssignment->setReminderWasAutomatic(1);
$reviewAssignmentDao->updateReviewAssignment($reviewAssignment);
}
示例2: sendReminder
function sendReminder($reviewAssignment, $submission, $context)
{
$reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO');
$userDao = DAORegistry::getDAO('UserDAO');
$reviewId = $reviewAssignment->getId();
$reviewer = $userDao->getById($reviewAssignment->getReviewerId());
if (!isset($reviewer)) {
return false;
}
import('classes.mail.ArticleMailTemplate');
$reviewerAccessKeysEnabled = $context->getSetting('reviewerAccessKeysEnabled');
$email = new ArticleMailTemplate($submission, $reviewerAccessKeysEnabled ? 'REVIEW_REMIND_AUTO_ONECLICK' : 'REVIEW_REMIND_AUTO', $context->getPrimaryLocale(), $context, false);
$email->setContext($context);
$email->setReplyTo(null);
$email->addRecipient($reviewer->getEmail(), $reviewer->getFullName());
$email->setSubject($email->getSubject($context->getPrimaryLocale()));
$email->setBody($email->getBody($context->getPrimaryLocale()));
$urlParams = array();
if ($reviewerAccessKeysEnabled) {
import('lib.pkp.classes.security.AccessKeyManager');
$accessKeyManager = new AccessKeyManager();
// Key lifetime is the typical review period plus four weeks
$keyLifetime = ($context->getSetting('numWeeksPerReview') + 4) * 7;
$urlParams['key'] = $accessKeyManager->createKey('ReviewerContext', $reviewer->getId(), $reviewId, $keyLifetime);
}
$submissionReviewUrl = Request::url($context->getPath(), 'reviewer', 'submission', $reviewId, $urlParams);
// Format the review due date
$reviewDueDate = strtotime($reviewAssignment->getDateDue());
$dateFormatShort = Config::getVar('general', 'date_format_short');
if ($reviewDueDate === -1 || $reviewDueDate === false) {
// Default to something human-readable if no date specified
$reviewDueDate = '_____';
} else {
$reviewDueDate = strftime($dateFormatShort, $reviewDueDate);
}
$paramArray = array('reviewerName' => $reviewer->getFullName(), 'reviewerUsername' => $reviewer->getUsername(), 'contextUrl' => Request::url($context->getPath()), 'reviewerPassword' => $reviewer->getPassword(), 'reviewDueDate' => $reviewDueDate, 'weekLaterDate' => strftime(Config::getVar('general', 'date_format_short'), strtotime('+1 week')), 'editorialContactSignature' => $context->getSetting('contactName') . "\n" . $context->getLocalizedName(), 'passwordResetUrl' => Request::url($context->getPath(), 'login', 'resetPassword', $reviewer->getUsername(), array('confirm' => Validation::generatePasswordResetHash($reviewer->getId()))), 'submissionReviewUrl' => $submissionReviewUrl);
$email->assignParams($paramArray);
$email->send();
$reviewAssignment->setDateReminded(Core::getCurrentDate());
$reviewAssignment->setReminderWasAutomatic(1);
$reviewAssignmentDao->updateObject($reviewAssignment);
}
示例3: email
/**
* Email the comment.
* @param $recipients array of recipients (email address => name)
*/
function email($recipients)
{
import('classes.mail.ArticleMailTemplate');
$email = new ArticleMailTemplate($this->article, 'SUBMISSION_COMMENT');
$journal =& Request::getJournal();
if ($journal) {
$email->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
}
foreach ($recipients as $emailAddress => $name) {
$email->addRecipient($emailAddress, $name);
$email->setSubject(strip_tags($this->article->getLocalizedTitle()));
$paramArray = array('name' => $name, 'commentName' => $this->user->getFullName(), 'comments' => String::html2text($this->getData('comments')));
$email->assignParams($paramArray);
$email->send();
$email->clearRecipients();
}
}
示例4: emailEditorDecisionComment
/**
* Email editor decision comment.
* @param $authorSubmission object
* @param $send boolean
* @param $request object
*/
function emailEditorDecisionComment($authorSubmission, $send, $request)
{
$userDao =& DAORegistry::getDAO('UserDAO');
$journal =& $request->getJournal();
$user =& $request->getUser();
import('classes.mail.ArticleMailTemplate');
$email = new ArticleMailTemplate($authorSubmission);
$editAssignments = $authorSubmission->getEditAssignments();
$editors = array();
foreach ($editAssignments as $editAssignment) {
array_push($editors, $userDao->getUser($editAssignment->getEditorId()));
}
if ($send && !$email->hasErrors()) {
HookRegistry::call('AuthorAction::emailEditorDecisionComment', array(&$authorSubmission, &$email));
$email->send($request);
$articleCommentDao =& DAORegistry::getDAO('ArticleCommentDAO');
$articleComment = new ArticleComment();
$articleComment->setCommentType(COMMENT_TYPE_EDITOR_DECISION);
$articleComment->setRoleId(ROLE_ID_AUTHOR);
$articleComment->setArticleId($authorSubmission->getId());
$articleComment->setAuthorId($authorSubmission->getUserId());
$articleComment->setCommentTitle($email->getSubject());
$articleComment->setComments($email->getBody());
$articleComment->setDatePosted(Core::getCurrentDate());
$articleComment->setViewable(true);
$articleComment->setAssocId($authorSubmission->getId());
$articleCommentDao->insertArticleComment($articleComment);
return true;
} else {
if (!$request->getUserVar('continued')) {
$email->setSubject($authorSubmission->getLocalizedTitle());
if (!empty($editors)) {
foreach ($editors as $editor) {
$email->addRecipient($editor->getEmail(), $editor->getFullName());
}
} else {
$email->addRecipient($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
}
}
$email->displayEditForm(Request::url(null, null, 'emailEditorDecisionComment', 'send'), array('articleId' => $authorSubmission->getId()), 'submission/comment/editorDecisionEmail.tpl');
return false;
}
}