当前位置: 首页>>代码示例>>PHP>>正文


PHP ArticleMailTemplate::setReplyTo方法代码示例

本文整理汇总了PHP中ArticleMailTemplate::setReplyTo方法的典型用法代码示例。如果您正苦于以下问题:PHP ArticleMailTemplate::setReplyTo方法的具体用法?PHP ArticleMailTemplate::setReplyTo怎么用?PHP ArticleMailTemplate::setReplyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ArticleMailTemplate的用法示例。


在下文中一共展示了ArticleMailTemplate::setReplyTo方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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('classes.mail.ArticleMailTemplate');
     $reviewerAccessKeysEnabled = $journal->getSetting('reviewerAccessKeysEnabled');
     $email = new ArticleMailTemplate($article, $reviewerAccessKeysEnabled ? 'REVIEW_REMIND_AUTO_ONECLICK' : 'REVIEW_REMIND_AUTO', $journal->getPrimaryLocale(), false, $journal, false, true);
     $email->setJournal($journal);
     $email->setReplyTo(null);
     $email->addRecipient($reviewer->getEmail(), $reviewer->getFullName());
     $email->setSubject($email->getSubject($journal->getPrimaryLocale()));
     $email->setBody($email->getBody($journal->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 = ($journal->getSetting('numWeeksPerReview') + 4) * 7;
         $urlParams['key'] = $accessKeyManager->createKey('ReviewerContext', $reviewer->getId(), $reviewId, $keyLifetime);
     }
     $submissionReviewUrl = Request::url($journal->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(), 'journalUrl' => $journal->getUrl(), 'reviewerPassword' => $reviewer->getPassword(), 'reviewDueDate' => $reviewDueDate, '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);
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:42,代码来源:ReviewReminder.inc.php

示例2: callbackAuthorDeposits

 /**
  * Hook registry function that is called when it's time to perform all automatic
  * deposits and notify the author of optional deposits.
  * @param $hookName string
  * @param $args array
  */
 function callbackAuthorDeposits($hookName, $args)
 {
     $sectionEditorSubmission =& $args[0];
     $request =& $this->getRequest();
     // Determine if the most recent decision was an "Accept"
     $decisions = $sectionEditorSubmission->getDecisions();
     $decisions = array_pop($decisions);
     // Rounds
     $decision = array_pop($decisions);
     $decisionConst = $decision ? $decision['decision'] : null;
     if ($decisionConst != SUBMISSION_EDITOR_DECISION_ACCEPT) {
         return false;
     }
     // The most recent decision was an "Accept"; perform auto deposits.
     $journal = $request->getJournal();
     $depositPoints = $this->getSetting($journal->getId(), 'depositPoints');
     import('classes.sword.OJSSwordDeposit');
     import('classes.notification.NotificationManager');
     $notificationManager = new NotificationManager();
     $sendDepositNotification = $this->getSetting($journal->getId(), 'allowAuthorSpecify') ? true : false;
     foreach ($depositPoints as $depositPoint) {
         $depositType = $depositPoint['type'];
         if ($depositType == SWORD_DEPOSIT_TYPE_OPTIONAL_SELECTION || $depositType == SWORD_DEPOSIT_TYPE_OPTIONAL_FIXED) {
             $sendDepositNotification = true;
         }
         if ($depositType != SWORD_DEPOSIT_TYPE_AUTOMATIC) {
             continue;
         }
         // For each automatic deposit point, perform a deposit.
         $deposit = new OJSSwordDeposit($sectionEditorSubmission);
         $deposit->setMetadata();
         $deposit->addEditorial();
         $deposit->createPackage();
         $deposit->deposit($depositPoint['url'], $depositPoint['username'], $depositPoint['password']);
         $deposit->cleanup();
         unset($deposit);
         $user = $request->getUser();
         $params = array('itemTitle' => $sectionEditorSubmission->getLocalizedTitle(), 'repositoryName' => $depositPoint['name']);
         $notificationManager->createTrivialNotification($user->getId(), NOTIFICATION_TYPE_SWORD_AUTO_DEPOSIT_COMPLETE, $params);
     }
     if ($sendDepositNotification) {
         $submittingUser = $sectionEditorSubmission->getUser();
         import('classes.mail.ArticleMailTemplate');
         $mail = new ArticleMailTemplate($sectionEditorSubmission, 'SWORD_DEPOSIT_NOTIFICATION', null, null, $journal, true, true);
         $mail->setReplyTo(null);
         $mail->addRecipient($submittingUser->getEmail(), $submittingUser->getFullName());
         $mail->assignParams(array('journalName' => $journal->getLocalizedName(), 'articleTitle' => $sectionEditorSubmission->getLocalizedTitle(), 'swordDepositUrl' => $request->url(null, 'sword', 'index', $sectionEditorSubmission->getId())));
         $mail->send($request);
     }
     return false;
 }
开发者ID:jalperin,项目名称:ojs,代码行数:57,代码来源:SwordPlugin.inc.php

示例3: email

 /**
  * Email the comment.
  * @param $recipients array of recipients (email address => name)
  * @param $request object
  */
 function email($recipients, $request)
 {
     import('classes.mail.ArticleMailTemplate');
     $email = new ArticleMailTemplate($this->article, 'SUBMISSION_COMMENT');
     $journal =& $request->getJournal();
     $email->setReplyTo(null);
     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($request);
         $email->clearRecipients();
     }
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:20,代码来源:EditCommentForm.inc.php

示例4: execute

 /**
  * Save changes to article.
  */
 function execute()
 {
     $articleDao =& DAORegistry::getDAO('ArticleDAO');
     $signoffDao =& DAORegistry::getDAO('SignoffDAO');
     $journal =& $this->request->getJournal();
     $user =& $this->request->getUser();
     // Update article
     $article =& $this->article;
     if ($this->getData('commentsToEditor') != '') {
         $article->setCommentsToEditor($this->getData('commentsToEditor'));
     }
     $article->setDateSubmitted(Core::getCurrentDate());
     $article->setSubmissionProgress(0);
     $article->stampStatusModified();
     $articleDao->updateArticle($article);
     // Setup default copyright/license metadata at finalization of submission.
     $article->initializePermissions();
     $articleDao->updateLocaleFields($article);
     // Designate this as the review version by default.
     $authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
     $authorSubmission =& $authorSubmissionDao->getAuthorSubmission($article->getId());
     AuthorAction::designateReviewVersion($authorSubmission, true);
     unset($authorSubmission);
     $copyeditInitialSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $article->getId());
     $copyeditAuthorSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_AUTHOR', ASSOC_TYPE_ARTICLE, $article->getId());
     $copyeditFinalSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $article->getId());
     $copyeditInitialSignoff->setUserId(0);
     $copyeditAuthorSignoff->setUserId($user->getId());
     $copyeditFinalSignoff->setUserId(0);
     $signoffDao->updateObject($copyeditInitialSignoff);
     $signoffDao->updateObject($copyeditAuthorSignoff);
     $signoffDao->updateObject($copyeditFinalSignoff);
     $layoutSignoff = $signoffDao->build('SIGNOFF_LAYOUT', ASSOC_TYPE_ARTICLE, $article->getId());
     $layoutSignoff->setUserId(0);
     $signoffDao->updateObject($layoutSignoff);
     $proofAuthorSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_AUTHOR', ASSOC_TYPE_ARTICLE, $article->getId());
     $proofProofreaderSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_PROOFREADER', ASSOC_TYPE_ARTICLE, $article->getId());
     $proofLayoutEditorSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_LAYOUT', ASSOC_TYPE_ARTICLE, $article->getId());
     $proofAuthorSignoff->setUserId($user->getId());
     $proofProofreaderSignoff->setUserId(0);
     $proofLayoutEditorSignoff->setUserId(0);
     $signoffDao->updateObject($proofAuthorSignoff);
     $signoffDao->updateObject($proofProofreaderSignoff);
     $signoffDao->updateObject($proofLayoutEditorSignoff);
     $sectionEditors = $this->assignEditors($article);
     // Send author notification email
     import('classes.mail.ArticleMailTemplate');
     $mail = new ArticleMailTemplate($article, 'SUBMISSION_ACK', null, null, null, false);
     $mail->setReplyTo(null);
     if ($mail->isEnabled()) {
         $mail->addRecipient($user->getEmail(), $user->getFullName());
         // If necessary, BCC the acknowledgement to someone.
         if ($journal->getSetting('copySubmissionAckPrimaryContact')) {
             $mail->addBcc($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
         }
         if ($journal->getSetting('copySubmissionAckSpecified')) {
             $copyAddress = $journal->getSetting('copySubmissionAckAddress');
             if (!empty($copyAddress)) {
                 $mail->addBcc($copyAddress);
             }
         }
         // Also BCC automatically assigned section editors
         foreach ($sectionEditors as $sectionEditorEntry) {
             $sectionEditor =& $sectionEditorEntry['user'];
             $mail->addBcc($sectionEditor->getEmail(), $sectionEditor->getFullName());
             unset($sectionEditor);
         }
         $mail->assignParams(array('authorName' => $user->getFullName(), 'authorUsername' => $user->getUsername(), 'editorialContactSignature' => $journal->getSetting('contactName') . "\n" . $journal->getLocalizedTitle(), 'submissionUrl' => $this->request->url(null, 'author', 'submission', $article->getId())));
         $mail->send($this->request);
     }
     import('classes.article.log.ArticleLog');
     ArticleLog::logEvent($this->request, $article, ARTICLE_LOG_ARTICLE_SUBMIT, 'log.author.submitted', array('authorName' => $user->getFullName()));
     return $this->articleId;
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:77,代码来源:AuthorSubmitStep5Form.inc.php

示例5: email

 /**
  * Email the comment.
  * @param $recipients array of recipients (email address => name)
  */
 function email($recipients, $request)
 {
     $article = $this->article;
     $articleCommentDao =& DAORegistry::getDAO('ArticleCommentDAO');
     $journal =& Request::getJournal();
     import('classes.mail.ArticleMailTemplate');
     $email = new ArticleMailTemplate($article, 'SUBMISSION_COMMENT');
     $email->setReplyTo($this->user->getEmail(), $this->user->getFullName());
     $commentText = $this->getData('comments');
     // Individually send an email to each of the recipients.
     foreach ($recipients as $emailAddress => $name) {
         $email->addRecipient($emailAddress, $name);
         $paramArray = array('name' => $name, 'commentName' => $this->user->getFullName(), 'comments' => String::html2text($commentText));
         $email->sendWithParams($paramArray, $request);
         $email->clearRecipients();
     }
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:21,代码来源:CommentForm.inc.php

示例6: recordRecommendation

 /**
  * Records the reviewer's submission recommendation.
  * @param $reviewId int
  * @param $recommendation int
  * @param $send boolean
  * @param $request object
  */
 function recordRecommendation(&$reviewerSubmission, $recommendation, $send, $request)
 {
     $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
     $userDao =& DAORegistry::getDAO('UserDAO');
     // Check validity of selected recommendation
     $reviewerRecommendationOptions =& ReviewAssignment::getReviewerRecommendationOptions();
     if (!isset($reviewerRecommendationOptions[$recommendation])) {
         return true;
     }
     $reviewAssignment =& $reviewAssignmentDao->getById($reviewerSubmission->getReviewId());
     $reviewer =& $userDao->getUser($reviewAssignment->getReviewerId());
     if (!isset($reviewer)) {
         return true;
     }
     // Only record the reviewers recommendation if
     // no recommendation has previously been submitted.
     if ($reviewAssignment->getRecommendation() === null || $reviewAssignment->getRecommendation === '') {
         import('classes.mail.ArticleMailTemplate');
         $email = new ArticleMailTemplate($reviewerSubmission, 'REVIEW_COMPLETE');
         // Must explicitly set sender because we may be here on an access
         // key, in which case the user is not technically logged in
         $email->setReplyTo($reviewer->getEmail(), $reviewer->getFullName());
         if (!$email->isEnabled() || $send && !$email->hasErrors()) {
             HookRegistry::call('ReviewerAction::recordRecommendation', array(&$reviewerSubmission, &$email, $recommendation));
             if ($email->isEnabled()) {
                 $email->send($request);
             }
             $reviewAssignment->setRecommendation($recommendation);
             $reviewAssignment->setDateCompleted(Core::getCurrentDate());
             $reviewAssignment->stampModified();
             $reviewAssignmentDao->updateReviewAssignment($reviewAssignment);
             // Add log
             import('classes.article.log.ArticleLog');
             ArticleLog::logEvent($request, $reviewerSubmission, ARTICLE_LOG_REVIEW_RECOMMENDATION, 'log.review.reviewRecommendationSet', array('reviewerName' => $reviewer->getFullName(), 'articleId' => $reviewAssignment->getSubmissionId(), 'round' => $reviewAssignment->getRound(), 'reviewId' => $reviewAssignment->getId()));
         } else {
             if (!$request->getUserVar('continued')) {
                 $assignedEditors = $email->ccAssignedEditors($reviewerSubmission->getId());
                 $reviewingSectionEditors = $email->toAssignedReviewingSectionEditors($reviewerSubmission->getId());
                 if (empty($assignedEditors) && empty($reviewingSectionEditors)) {
                     $journal =& Request::getJournal();
                     $email->addRecipient($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
                     $editorialContactName = $journal->getSetting('contactName');
                 } else {
                     if (!empty($reviewingSectionEditors)) {
                         $editorialContact = array_shift($reviewingSectionEditors);
                     } else {
                         $editorialContact = array_shift($assignedEditors);
                     }
                     $editorialContactName = $editorialContact->getEditorFullName();
                 }
                 $reviewerRecommendationOptions =& ReviewAssignment::getReviewerRecommendationOptions();
                 $email->assignParams(array('editorialContactName' => $editorialContactName, 'reviewerName' => $reviewer->getFullName(), 'articleTitle' => strip_tags($reviewerSubmission->getLocalizedTitle()), 'recommendation' => __($reviewerRecommendationOptions[$recommendation])));
             }
             $email->displayEditForm($request->url(null, 'reviewer', 'recordRecommendation'), array('reviewId' => $reviewerSubmission->getReviewId(), 'recommendation' => $recommendation));
             return false;
         }
     }
     return true;
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:66,代码来源:ReviewerAction.inc.php


注:本文中的ArticleMailTemplate::setReplyTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。