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


PHP ArticleMailTemplate::bccAssignedSubEditors方法代码示例

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


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


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