本文整理汇总了PHP中MailTemplate::addHeader方法的典型用法代码示例。如果您正苦于以下问题:PHP MailTemplate::addHeader方法的具体用法?PHP MailTemplate::addHeader怎么用?PHP MailTemplate::addHeader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MailTemplate
的用法示例。
在下文中一共展示了MailTemplate::addHeader方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
}