本文整理汇总了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();
}
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
示例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();
}
示例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;
}
示例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'));
}
}
示例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'));
}
}
示例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();
}