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


PHP MailTemplate::setSubject方法代码示例

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


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

示例1: sendNotification

 function sendNotification($users, $journal, $issue)
 {
     if ($users->getCount() != 0) {
         import('lib.pkp.classes.mail.MailTemplate');
         $email = new MailTemplate('OPEN_ACCESS_NOTIFY', $journal->getPrimaryLocale());
         $email->setSubject($email->getSubject($journal->getPrimaryLocale()));
         $email->setReplyTo(null);
         $email->addRecipient($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
         $paramArray = array('journalName' => $journal->getLocalizedName(), 'journalUrl' => Request::url($journal->getPath()), 'editorialContactSignature' => $journal->getSetting('contactName') . "\n" . $journal->getLocalizedName());
         $email->assignParams($paramArray);
         $publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
         $publishedArticles = $publishedArticleDao->getPublishedArticlesInSections($issue->getId());
         $mimeBoundary = '==boundary_' . md5(microtime());
         $templateMgr = TemplateManager::getManager();
         $templateMgr->assign('body', $email->getBody($journal->getPrimaryLocale()));
         $templateMgr->assign('templateSignature', $journal->getSetting('emailSignature'));
         $templateMgr->assign('mimeBoundary', $mimeBoundary);
         $templateMgr->assign('issue', $issue);
         $templateMgr->assign('publishedArticles', $publishedArticles);
         $email->addHeader('MIME-Version', '1.0');
         $email->setContentType('multipart/alternative; boundary="' . $mimeBoundary . '"');
         $email->setBody($templateMgr->fetch('subscription/openAccessNotifyEmail.tpl'));
         while ($user = $users->next()) {
             $email->addBcc($user->getEmail(), $user->getFullName());
         }
         $email->send();
     }
 }
开发者ID:laelnasan,项目名称:UTFPR-ojs,代码行数:28,代码来源:OpenAccessNotification.inc.php

示例2: sendReminder

 function sendReminder($subscription, $journal, $emailKey)
 {
     $userDao = DAORegistry::getDAO('UserDAO');
     $subscriptionTypeDao = DAORegistry::getDAO('SubscriptionTypeDAO');
     $journalName = $journal->getLocalizedName();
     $user = $userDao->getById($subscription->getUserId());
     if (!isset($user)) {
         return false;
     }
     $subscriptionType = $subscriptionTypeDao->getSubscriptionType($subscription->getTypeId());
     $subscriptionName = $journal->getSetting('subscriptionName');
     $subscriptionEmail = $journal->getSetting('subscriptionEmail');
     $subscriptionPhone = $journal->getSetting('subscriptionPhone');
     $subscriptionMailingAddress = $journal->getSetting('subscriptionMailingAddress');
     $subscriptionContactSignature = $subscriptionName;
     AppLocale::requireComponents(LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_APP_COMMON);
     if ($subscriptionMailingAddress != '') {
         $subscriptionContactSignature .= "\n" . $subscriptionMailingAddress;
     }
     if ($subscriptionPhone != '') {
         $subscriptionContactSignature .= "\n" . AppLocale::Translate('user.phone') . ': ' . $subscriptionPhone;
     }
     $subscriptionContactSignature .= "\n" . AppLocale::Translate('user.email') . ': ' . $subscriptionEmail;
     $paramArray = array('subscriberName' => $user->getFullName(), 'journalName' => $journalName, 'subscriptionType' => $subscriptionType->getSummaryString(), 'expiryDate' => $subscription->getDateEnd(), 'username' => $user->getUsername(), 'subscriptionContactSignature' => $subscriptionContactSignature);
     import('lib.pkp.classes.mail.MailTemplate');
     $mail = new MailTemplate($emailKey, $journal->getPrimaryLocale(), $journal, false);
     $mail->setReplyTo($subscriptionEmail, $subscriptionName);
     $mail->addRecipient($user->getEmail(), $user->getFullName());
     $mail->setSubject($mail->getSubject($journal->getPrimaryLocale()));
     $mail->setBody($mail->getBody($journal->getPrimaryLocale()));
     $mail->assignParams($paramArray);
     $mail->send();
 }
开发者ID:mariojp,项目名称:ojs,代码行数:33,代码来源:SubscriptionExpiryReminder.inc.php

示例3: sendReminder

 /**
  * Send email to a book for review author
  */
 function sendReminder($book, $journal, $emailKey)
 {
     $journalId = $journal->getId();
     $paramArray = array('authorName' => strip_tags($book->getUserFullName()), 'bookForReviewTitle' => '"' . strip_tags($book->getLocalizedTitle()) . '"', 'bookForReviewDueDate' => date('l, F j, Y', strtotime($book->getDateDue())), 'submissionUrl' => Request::url(null, 'author', 'submit'), 'editorialContactSignature' => strip_tags($book->getEditorContactSignature()));
     import('classes.mail.MailTemplate');
     $mail = new MailTemplate($emailKey);
     $mail->setReplyTo($book->getEditorEmail(), $book->getEditorFullName());
     $mail->addRecipient($book->getUserEmail(), $book->getUserFullName());
     $mail->setSubject($mail->getSubject($journal->getPrimaryLocale()));
     $mail->setBody($mail->getBody($journal->getPrimaryLocale()));
     $mail->assignParams($paramArray);
     $mail->send();
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:16,代码来源:BooksForReviewReminder.inc.php

示例4: execute

 /**
  * Send the email
  * @param $args array
  * @param $request PKPRequest
  */
 function execute($args, $request)
 {
     $userDao = DAORegistry::getDAO('UserDAO');
     $toUser = $userDao->getById($this->userId);
     $fromUser = $request->getUser();
     import('lib.pkp.classes.mail.MailTemplate');
     $email = new MailTemplate();
     $email->addRecipient($toUser->getEmail(), $toUser->getFullName());
     $email->setReplyTo($fromUser->getEmail(), $fromUser->getFullName());
     $email->setSubject($this->getData('subject'));
     $email->setBody($this->getData('message'));
     $email->send();
 }
开发者ID:mczirfusz,项目名称:pkp-lib,代码行数:18,代码来源:UserEmailForm.inc.php

示例5: sendReminder

 /**
  * Send email to object for review author
  * @param $ofrAssignment ObjectForReviewAssignment
  * @param $journal Journal
  * @param $emailKey string
  */
 function sendReminder($ofrAssignment, $journal, $emailKey)
 {
     $journalId = $journal->getId();
     $author =& $ofrAssignment->getUser();
     $objectForReview =& $ofrAssignment->getObjectForReview();
     $editor =& $objectForReview->getEditor();
     $paramArray = array('authorName' => strip_tags($author->getFullName()), 'objectForReviewTitle' => '"' . strip_tags($objectForReview->getTitle()) . '"', 'objectForReviewDueDate' => date('l, F j, Y', strtotime($ofrAssignment->getDateDue())), 'submissionUrl' => Request::url($journal->getPath(), 'author', 'submit'), 'editorialContactSignature' => strip_tags($editor->getContactSignature()));
     import('classes.mail.MailTemplate');
     $mail = new MailTemplate($emailKey);
     $mail->setReplyTo($editor->getEmail(), $editor->getFullName());
     $mail->addRecipient($author->getEmail(), $author->getFullName());
     $mail->setSubject($mail->getSubject($journal->getPrimaryLocale()));
     $mail->setBody($mail->getBody($journal->getPrimaryLocale()));
     $mail->assignParams($paramArray);
     $mail->send();
     $ofrAssignment->setDateReminded(Core::getCurrentDate());
     $ofrAssignmentDao =& DAORegistry::getDAO('ObjectForReviewAssignmentDAO');
     $ofrAssignmentDao->updateObject($ofrAssignment);
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:25,代码来源:ObjectsForReviewReminder.inc.php

示例6: sendReminder

 function sendReminder($registration, $conference, $schedConf, $emailKey)
 {
     $userDao =& DAORegistry::getDAO('UserDAO');
     $registrationTypeDao =& DAORegistry::getDAO('RegistrationTypeDAO');
     $schedConfName = $schedConf->getSchedConfTitle();
     $schedConfId = $schedConf->getId();
     $user =& $userDao->getUser($registration->getUserId());
     if (!isset($user)) {
         return false;
     }
     $registrationType =& $registrationTypeDao->getRegistrationType($registration->getTypeId());
     $registrationName = $schedConf->getSetting('registrationName');
     $registrationEmail = $schedConf->getSetting('registrationEmail');
     $registrationPhone = $schedConf->getSetting('registrationPhone');
     $registrationFax = $schedConf->getSetting('registrationFax');
     $registrationMailingAddress = $schedConf->getSetting('registrationMailingAddress');
     $registrationContactSignature = $registrationName;
     if ($registrationMailingAddress != '') {
         $registrationContactSignature .= "\n" . $registrationMailingAddress;
     }
     if ($registrationPhone != '') {
         $registrationContactSignature .= "\n" . AppLocale::Translate('user.phone') . ': ' . $registrationPhone;
     }
     if ($registrationFax != '') {
         $registrationContactSignature .= "\n" . AppLocale::Translate('user.fax') . ': ' . $registrationFax;
     }
     $registrationContactSignature .= "\n" . AppLocale::Translate('user.email') . ': ' . $registrationEmail;
     $paramArray = array('registrantName' => $user->getFullName(), 'conferenceName' => $conferenceName, 'schedConfName' => $schedConfName, 'registrationType' => $registrationType->getSummaryString(), 'expiryDate' => $registration->getDateEnd(), 'username' => $user->getUsername(), 'registrationContactSignature' => $registrationContactSignature);
     import('mail.MailTemplate');
     $mail = new MailTemplate($emailKey, $conference->getPrimaryLocale());
     $mail->setFrom($registrationEmail, $registrationName);
     $mail->addRecipient($user->getEmail(), $user->getFullName());
     $mail->setSubject($mail->getSubject($conference->getPrimaryLocale()));
     $mail->setBody($mail->getBody($conference->getPrimaryLocale()));
     $mail->assignParams($paramArray);
     $mail->send();
 }
开发者ID:sedici,项目名称:ocs,代码行数:37,代码来源:RegistrationExpiryReminder.inc.php

示例7: array

 /**
  * Internal function to prepare notification email
  */
 function &_prepareNotificationEmail($mailTemplateKey)
 {
     $userDao =& DAORegistry::getDAO('UserDAO');
     $subscriptionTypeDao =& DAORegistry::getDAO('SubscriptionTypeDAO');
     $journalSettingsDao =& DAORegistry::getDAO('JournalSettingsDAO');
     $journal =& Request::getJournal();
     $journalName = $journal->getLocalizedTitle();
     $journalId = $journal->getId();
     $user =& $userDao->getUser($this->subscription->getUserId());
     $subscriptionType =& $subscriptionTypeDao->getSubscriptionType($this->subscription->getTypeId());
     $subscriptionName = $journalSettingsDao->getSetting($journalId, 'subscriptionName');
     $subscriptionEmail = $journalSettingsDao->getSetting($journalId, 'subscriptionEmail');
     $subscriptionPhone = $journalSettingsDao->getSetting($journalId, 'subscriptionPhone');
     $subscriptionFax = $journalSettingsDao->getSetting($journalId, 'subscriptionFax');
     $subscriptionMailingAddress = $journalSettingsDao->getSetting($journalId, 'subscriptionMailingAddress');
     $subscriptionContactSignature = $subscriptionName;
     if ($subscriptionMailingAddress != '') {
         $subscriptionContactSignature .= "\n" . $subscriptionMailingAddress;
     }
     if ($subscriptionPhone != '') {
         $subscriptionContactSignature .= "\n" . Locale::translate('user.phone') . ': ' . $subscriptionPhone;
     }
     if ($subscriptionFax != '') {
         $subscriptionContactSignature .= "\n" . Locale::translate('user.fax') . ': ' . $subscriptionFax;
     }
     $subscriptionContactSignature .= "\n" . Locale::translate('user.email') . ': ' . $subscriptionEmail;
     $paramArray = array('subscriberName' => $user->getFullName(), 'journalName' => $journalName, 'subscriptionType' => $subscriptionType->getSummaryString(), 'username' => $user->getUsername(), 'subscriptionContactSignature' => $subscriptionContactSignature);
     import('classes.mail.MailTemplate');
     $mail = new MailTemplate($mailTemplateKey);
     $mail->setFrom($subscriptionEmail, $subscriptionName);
     $mail->addRecipient($user->getEmail(), $user->getFullName());
     $mail->setSubject($mail->getSubject($journal->getPrimaryLocale()));
     $mail->setBody($mail->getBody($journal->getPrimaryLocale()));
     $mail->assignParams($paramArray);
     return $mail;
 }
开发者ID:master3395,项目名称:CBPPlatform,代码行数:39,代码来源:SubscriptionForm.inc.php

示例8: emailAuthor

 /**
  * Display the "email author"
  * @param $args array
  * @param $request Request
  */
 function emailAuthor($args, &$request)
 {
     $router =& $request->getRouter();
     $this->setupTemplate();
     $paperId = isset($args[0]) ? $args[0] : 0;
     $galleyId = isset($args[1]) ? (int) $args[1] : 0;
     $this->validate($request, $paperId, $galleyId);
     $conference =& $router->getContext($request, CONTEXT_CONFERENCE);
     $schedConf =& $router->getContext($request, CONTEXT_SCHED_CONF);
     $paper =& $this->paper;
     $rtDao =& DAORegistry::getDAO('RTDAO');
     $conferenceRt =& $rtDao->getConferenceRTByConference($conference);
     $user =& $request->getUser();
     if (!$conferenceRt || !$conferenceRt->getEmailAuthor() || !$user) {
         $request->redirect(null, null, $router->getRequestedPage($request));
     }
     import('mail.MailTemplate');
     $email = new MailTemplate();
     if ($request->getUserVar('send') && !$email->hasErrors()) {
         $email->send();
         $templateMgr =& TemplateManager::getManager();
         $templateMgr->display('rt/sent.tpl');
     } else {
         if (!$request->getUserVar('continued')) {
             $email->setSubject('[' . $schedConf->getLocalizedSetting('acronym') . '] ' . strip_tags($paper->getLocalizedTitle()));
             $authors =& $paper->getAuthors();
             $author =& $authors[0];
             $email->addRecipient($author->getEmail(), $author->getFullName());
         }
         $email->displayEditForm($router->url($request, null, null, null, 'emailAuthor', array($paperId, $galleyId)), null, 'rt/email.tpl', array('op' => 'emailAuthor'));
     }
 }
开发者ID:jalperin,项目名称:ocs,代码行数:37,代码来源:RTHandler.inc.php

示例9: emailAuthor

 /**
  * Display the "email author" form
  * @param $args array
  * @param $request Request
  */
 function emailAuthor($args, &$request)
 {
     $router =& $request->getRouter();
     $this->setupTemplate();
     $articleId = isset($args[0]) ? $args[0] : 0;
     $galleyId = isset($args[1]) ? (int) $args[1] : 0;
     $this->validate($request, $articleId, $galleyId);
     $journal =& $router->getContext($request);
     $article =& $this->article;
     $rtDao =& DAORegistry::getDAO('RTDAO');
     $journalRt =& $rtDao->getJournalRTByJournal($journal);
     $user =& $request->getUser();
     if (!$journalRt || !$journalRt->getEmailAuthor() || !$user) {
         $request->redirect(null, $router->getRequestedPage($request));
     }
     import('classes.mail.MailTemplate');
     $email = new MailTemplate();
     $email->setAddressFieldsEnabled(false);
     if ($request->getUserVar('send') && !$email->hasErrors()) {
         $authors =& $article->getAuthors();
         $author =& $authors[0];
         $email->addRecipient($author->getEmail(), $author->getFullName());
         $email->send();
         $templateMgr =& TemplateManager::getManager();
         $templateMgr->display('rt/sent.tpl');
     } else {
         if (!$request->getUserVar('continued')) {
             $email->setSubject('[' . $journal->getLocalizedSetting('initials') . '] ' . strip_tags($article->getLocalizedTitle()));
         }
         $email->displayEditForm($router->url($request, null, null, 'emailAuthor', array($articleId, $galleyId)), null, 'rt/email.tpl', array('op' => 'emailAuthor'));
     }
 }
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:37,代码来源:RTHandler.inc.php

示例10: sendOnlinePaymentNotificationEmail

 /**
  * Send notification email to Subscription Manager when online payment is completed.
  */
 function sendOnlinePaymentNotificationEmail(&$subscription, $mailTemplateKey)
 {
     $validKeys = array('SUBSCRIPTION_PURCHASE_INDL', 'SUBSCRIPTION_PURCHASE_INSTL', 'SUBSCRIPTION_RENEW_INDL', 'SUBSCRIPTION_RENEW_INSTL');
     if (!in_array($mailTemplateKey, $validKeys)) {
         return false;
     }
     $journal =& Request::getJournal();
     $subscriptionContactName = $journal->getSetting('subscriptionName');
     $subscriptionContactEmail = $journal->getSetting('subscriptionEmail');
     if (empty($subscriptionContactEmail)) {
         $subscriptionContactEmail = $journal->getSetting('contactEmail');
         $subscriptionContactName = $journal->getSetting('contactName');
     }
     if (empty($subscriptionContactEmail)) {
         return false;
     }
     $userDao =& DAORegistry::getDAO('UserDAO');
     $user =& $userDao->getUser($subscription->getUserId());
     $subscriptionTypeDao =& DAORegistry::getDAO('SubscriptionTypeDAO');
     $subscriptionType =& $subscriptionTypeDao->getSubscriptionType($subscription->getTypeId());
     $roleDao =& DAORegistry::getDAO('RoleDAO');
     if ($roleDao->getJournalUsersRoleCount($journal->getId(), ROLE_ID_SUBSCRIPTION_MANAGER) > 0) {
         $rolePath = $roleDao->getRolePath(ROLE_ID_SUBSCRIPTION_MANAGER);
     } else {
         $rolePath = $roleDao->getRolePath(ROLE_ID_JOURNAL_MANAGER);
     }
     $paramArray = array('subscriptionType' => $subscriptionType->getSummaryString(), 'userDetails' => $user->getContactSignature(), 'membership' => $subscription->getMembership());
     switch ($mailTemplateKey) {
         case 'SUBSCRIPTION_PURCHASE_INDL':
         case 'SUBSCRIPTION_RENEW_INDL':
             $paramArray['subscriptionUrl'] = Request::url($journal->getPath(), $rolePath, 'editSubscription', 'individual', array($subscription->getId()));
             break;
         case 'SUBSCRIPTION_PURCHASE_INSTL':
         case 'SUBSCRIPTION_RENEW_INSTL':
             $paramArray['subscriptionUrl'] = Request::url($journal->getPath(), $rolePath, 'editSubscription', 'institutional', array($subscription->getId()));
             $paramArray['institutionName'] = $subscription->getInstitutionName();
             $paramArray['institutionMailingAddress'] = $subscription->getInstitutionMailingAddress();
             $paramArray['domain'] = $subscription->getDomain();
             $paramArray['ipRanges'] = $subscription->getIPRangesString();
             break;
     }
     import('classes.mail.MailTemplate');
     $mail = new MailTemplate($mailTemplateKey);
     $mail->setFrom($subscriptionContactEmail, $subscriptionContactName);
     $mail->addRecipient($subscriptionContactEmail, $subscriptionContactName);
     $mail->setSubject($mail->getSubject($journal->getPrimaryLocale()));
     $mail->setBody($mail->getBody($journal->getPrimaryLocale()));
     $mail->assignParams($paramArray);
     $mail->send();
 }
开发者ID:EreminDm,项目名称:water-cao,代码行数:53,代码来源:SubscriptionAction.inc.php


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