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


PHP ArticleMailTemplate::addBcc方法代码示例

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


在下文中一共展示了ArticleMailTemplate::addBcc方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 /**
  * Save changes to submission.
  * @param $args array
  * @param $request PKPRequest
  * @return int the submission ID
  */
 function execute($args, $request)
 {
     parent::execute($args, $request);
     $submission = $this->submission;
     // Send author notification email
     import('classes.mail.ArticleMailTemplate');
     $mail = new ArticleMailTemplate($submission, 'SUBMISSION_ACK');
     $authorMail = new ArticleMailTemplate($submission, 'SUBMISSION_ACK_NOT_USER');
     $context = $request->getContext();
     $router = $request->getRouter();
     if ($mail->isEnabled()) {
         // submission ack emails should be from the contact.
         $mail->setFrom($this->context->getSetting('contactEmail'), $this->context->getSetting('contactName'));
         $authorMail->setFrom($this->context->getSetting('contactEmail'), $this->context->getSetting('contactName'));
         $user = $request->getUser();
         $primaryAuthor = $submission->getPrimaryAuthor();
         if (!isset($primaryAuthor)) {
             $authors = $submission->getAuthors();
             $primaryAuthor = $authors[0];
         }
         $mail->addRecipient($user->getEmail(), $user->getFullName());
         // Add primary contact and e-mail address as specified in the journal submission settings
         if ($context->getSetting('copySubmissionAckPrimaryContact')) {
             $mail->addBcc($context->getSetting('contactEmail'), $context->getSetting('contactName'));
         }
         if ($copyAddress = $context->getSetting('copySubmissionAckAddress')) {
             $mail->addBcc($copyAddress);
         }
         if ($user->getEmail() != $primaryAuthor->getEmail()) {
             $authorMail->addRecipient($primaryAuthor->getEmail(), $primaryAuthor->getFullName());
         }
         $assignedAuthors = $submission->getAuthors();
         foreach ($assignedAuthors as $author) {
             $authorEmail = $author->getEmail();
             // only add the author email if they have not already been added as the primary author
             // or user creating the submission.
             if ($authorEmail != $primaryAuthor->getEmail() && $authorEmail != $user->getEmail()) {
                 $authorMail->addRecipient($author->getEmail(), $author->getFullName());
             }
         }
         $mail->bccAssignedSubEditors($submission->getId(), WORKFLOW_STAGE_ID_SUBMISSION);
         $mail->assignParams(array('authorName' => $user->getFullName(), 'authorUsername' => $user->getUsername(), 'editorialContactSignature' => $context->getSetting('contactName'), 'submissionUrl' => $router->url($request, null, 'authorDashboard', 'submission', $submission->getId())));
         $authorMail->assignParams(array('submitterName' => $user->getFullName(), 'editorialContactSignature' => $context->getSetting('contactName')));
         $mail->send($request);
         $recipients = $authorMail->getRecipients();
         if (!empty($recipients)) {
             $authorMail->send($request);
         }
     }
     // Log submission.
     import('classes.log.SubmissionEventLogEntry');
     // Constants
     import('lib.pkp.classes.log.SubmissionLog');
     SubmissionLog::logEvent($request, $submission, SUBMISSION_LOG_SUBMISSION_SUBMIT, 'submission.event.submissionSubmitted');
     return $this->submissionId;
 }
开发者ID:pkp,项目名称:ojs,代码行数:62,代码来源:SubmissionSubmitStep4Form.inc.php

示例2: execute

 /**
  * Save changes to article.
  */
 function execute()
 {
     $articleDao =& DAORegistry::getDAO('ArticleDAO');
     $signoffDao =& DAORegistry::getDAO('SignoffDAO');
     $journal = Request::getJournal();
     $user = 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);
     // 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);
     $user =& Request::getUser();
     // Update search index
     import('classes.search.ArticleSearchIndex');
     ArticleSearchIndex::indexArticleMetadata($article);
     ArticleSearchIndex::indexArticleFiles($article);
     // Send author notification email
     import('classes.mail.ArticleMailTemplate');
     $mail = new ArticleMailTemplate($article, 'SUBMISSION_ACK', null, null, null, false);
     $mail->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
     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' => Request::url(null, 'author', 'submission', $article->getId())));
         $mail->send();
     }
     import('classes.article.log.ArticleLog');
     import('classes.article.log.ArticleEventLogEntry');
     ArticleLog::logEvent($this->articleId, ARTICLE_LOG_ARTICLE_SUBMIT, ARTICLE_LOG_TYPE_AUTHOR, $user->getId(), 'log.author.submitted', array('submissionId' => $article->getId(), 'authorName' => $user->getFullName()));
     return $this->articleId;
 }
开发者ID:master3395,项目名称:CBPPlatform,代码行数:80,代码来源:AuthorSubmitStep5Form.inc.php

示例3: bccEditorDecisionCommentToReviewers

 /**
  * Blind CC the editor decision email to reviewers.
  * @param $article object
  * @param $send boolean
  * @return boolean true iff ready for redirect
  */
 function bccEditorDecisionCommentToReviewers($article, $send, $request)
 {
     import('classes.mail.ArticleMailTemplate');
     $email = new ArticleMailTemplate($article, 'SUBMISSION_DECISION_REVIEWERS');
     if ($send && !$email->hasErrors()) {
         HookRegistry::call('SectionEditorAction::bccEditorDecisionCommentToReviewers', array(&$article, &$reviewAssignments, &$email));
         $email->send($request);
         return true;
     } else {
         if (!$request->getUserVar('continued')) {
             $userDao =& DAORegistry::getDAO('UserDAO');
             $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
             $reviewAssignments =& $reviewAssignmentDao->getBySubmissionId($article->getId(), $article->getCurrentRound());
             $email->clearRecipients();
             foreach ($reviewAssignments as $reviewAssignment) {
                 if ($reviewAssignment->getDateCompleted() != null && !$reviewAssignment->getCancelled()) {
                     $reviewer =& $userDao->getUser($reviewAssignment->getReviewerId());
                     if (isset($reviewer)) {
                         $email->addBcc($reviewer->getEmail(), $reviewer->getFullName());
                     }
                 }
             }
             $commentsText = "";
             if ($article->getMostRecentEditorDecisionComment()) {
                 $comment = $article->getMostRecentEditorDecisionComment();
                 $commentsText = String::html2text($comment->getComments()) . "\n\n";
             }
             $user =& $request->getUser();
             $paramArray = array('comments' => $commentsText, 'editorialContactSignature' => $user->getContactSignature());
             $email->assignParams($paramArray);
         }
         $email->displayEditForm($request->url(null, null, 'bccEditorDecisionCommentToReviewers', 'send'), array('articleId' => $article->getId()));
         return false;
     }
 }
开发者ID:yuricampos,项目名称:ojs,代码行数:41,代码来源:SectionEditorAction.inc.php

示例4: blindCcReviewsToReviewers

 /**
  * Blind CC the reviews to reviewers.
  * @param $article object
  * @param $send boolean
  * @param $inhibitExistingEmail boolean
  * @return boolean true iff ready for redirect
  */
 function blindCcReviewsToReviewers($article, $send = false, $inhibitExistingEmail = false)
 {
     $commentDao =& DAORegistry::getDAO('ArticleCommentDAO');
     $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
     $userDao =& DAORegistry::getDAO('UserDAO');
     $journal =& Request::getJournal();
     $comments =& $commentDao->getArticleComments($article->getId(), COMMENT_TYPE_EDITOR_DECISION);
     $reviewAssignments =& $reviewAssignmentDao->getBySubmissionId($article->getId(), $article->getCurrentRound());
     $commentsText = "";
     foreach ($comments as $comment) {
         $commentsText .= String::html2text($comment->getComments()) . "\n\n";
     }
     $user =& Request::getUser();
     import('classes.mail.ArticleMailTemplate');
     $email = new ArticleMailTemplate($article, 'SUBMISSION_DECISION_REVIEWERS', null, null, null, true, true);
     if ($send && !$email->hasErrors() && !$inhibitExistingEmail) {
         HookRegistry::call('SectionEditorAction::blindCcReviewsToReviewers', array(&$article, &$reviewAssignments, &$email));
         $email->send();
         return true;
     } else {
         if ($inhibitExistingEmail || !Request::getUserVar('continued')) {
             $email->clearRecipients();
             foreach ($reviewAssignments as $reviewAssignment) {
                 if ($reviewAssignment->getDateCompleted() != null && !$reviewAssignment->getCancelled()) {
                     $reviewer =& $userDao->getUser($reviewAssignment->getReviewerId());
                     if (isset($reviewer)) {
                         $email->addBcc($reviewer->getEmail(), $reviewer->getFullName());
                     }
                 }
             }
             $paramArray = array('comments' => $commentsText, 'editorialContactSignature' => $user->getContactSignature());
             $email->assignParams($paramArray);
         }
         $email->displayEditForm(Request::url(null, null, 'blindCcReviewsToReviewers'), array('articleId' => $article->getId()));
         return false;
     }
 }
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:44,代码来源:SectionEditorAction.inc.php

示例5: execute

 /**
  * Save changes to article.
  */
 function execute()
 {
     $articleDao =& DAORegistry::getDAO('ArticleDAO');
     $signoffDao =& DAORegistry::getDAO('SignoffDAO');
     $sectionDao =& DAORegistry::getDAO('SectionDAO');
     $ercReviewersDao =& DAORegistry::getDAO('ErcReviewersDAO');
     $institutionDao =& DAORegistry::getDAO('InstitutionDAO');
     $journal = Request::getJournal();
     $user = Request::getUser();
     // Update article
     $article =& $this->article;
     if ($article->getDateSubmitted() == null) {
         $year = substr(Core::getCurrentDate(), 0, 4);
         $countyear = $articleDao->getSubmissionsForYearCount($year) + 1;
         $pSponsor = $article->getArticlePrimarySponsor();
         $institution = $institutionDao->getInstitutionById($pSponsor->getInstitutionId());
         $article->setProposalId($year . '-' . $countyear . '-' . $institution->getInstitutionAcronym());
     }
     if ($this->getData('commentsToEditor') != '') {
         $article->setCommentsToEditor($this->getData('commentsToEditor'));
     }
     $article->setDateSubmitted(Core::getCurrentDate());
     $article->setSubmissionProgress(0);
     $article->stampStatusModified();
     $articleDao->updateArticle($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);
     $sectionEditorsDao =& DAORegistry::getDAO('SectionEditorsDAO');
     $sectionEditors =& $sectionEditorsDao->getEditorsBySectionId($journal->getId(), $article->getSectionId());
     $user =& Request::getUser();
     // Update search index
     import('classes.search.ArticleSearchIndex');
     ArticleSearchIndex::indexArticleMetadata($article);
     ArticleSearchIndex::indexArticleFiles($article);
     // Send author notification email
     import('classes.mail.ArticleMailTemplate');
     $mail = new ArticleMailTemplate($article, null, 'SUBMISSION_ACK', null, null, null, false);
     foreach ($sectionEditors as $sectionEditor) {
         // If one of the secretary is the chair of the committee, send from the chair, if not, take the last secretary in the array
         $from = $mail->getFrom();
         if ($ercReviewersDao->isErcReviewer($journal->getId(), $sectionEditor->getId(), REVIEWER_CHAIR)) {
             $mail->setFrom($sectionEditor->getEmail(), $sectionEditor->getFullName());
         } elseif ($from['email'] == $user->getEmail()) {
             $mail->setFrom($sectionEditor->getEmail(), $sectionEditor->getFullName());
         }
         $mail->addBcc($sectionEditor->getEmail(), $sectionEditor->getFullName());
         unset($sectionEditor);
     }
     if ($mail->isEnabled()) {
         $mail->addRecipient($user->getEmail(), $user->getFullName());
         if ($journal->getSetting('copySubmissionAckSpecified')) {
             $copyAddress = $journal->getSetting('copySubmissionAckAddress');
             if (!empty($copyAddress)) {
                 $mail->addBcc($copyAddress);
             }
         }
         $section = $sectionDao->getSection($article->getSectionId());
         $mail->assignParams(array('authorName' => $user->getFullName(), 'authorUsername' => $user->getUsername(), 'address' => $sectionDao->getSettingValue($article->getSectionId(), 'address'), 'bankAccount' => $sectionDao->getSettingValue($article->getSectionId(), 'bankAccount'), 'proposalId' => $article->getProposalId(), 'submissionUrl' => Request::url(null, 'author', 'submission', $article->getId())));
         $mail->send();
     }
     // Send a regular notification to section editors
     $lastDecision = $article->getLastSectionDecision();
     switch ($lastDecision->getReviewType()) {
         case REVIEW_TYPE_INITIAL:
             if ($lastDecision->getRound() == 1) {
                 $message = 'notification.type.articleSubmitted.initialReview';
             } else {
                 $message = 'notification.type.articleReSubmitted.initialReview';
             }
             break;
         case REVIEW_TYPE_PR:
             if ($lastDecision->getRound() == 1) {
                 $message = 'notification.type.articleSubmitted.continuingReview';
//.........这里部分代码省略.........
开发者ID:elavaud,项目名称:hrp_ct,代码行数:101,代码来源:AuthorSubmitStep9Form.inc.php


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