本文整理汇总了PHP中TikiMail::buildMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP TikiMail::buildMessage方法的具体用法?PHP TikiMail::buildMessage怎么用?PHP TikiMail::buildMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TikiMail
的用法示例。
在下文中一共展示了TikiMail::buildMessage方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendFileGalleryEmailNotification
function sendFileGalleryEmailNotification($event, $galleryId, $galleryName, $name, $filename, $description, $action, $user)
{
global $tikilib, $feature_user_watches, $smarty, $userlib, $sender_email;
$nots = array();
$defaultLanguage = $tikilib->get_preference("language", "en");
// Users watching this gallery
if ($feature_user_watches == 'y') {
$nots = $tikilib->get_event_watches($event, $galleryId);
for ($i = count($nots) - 1; $i >= 0; --$i) {
$nots[$i]['language'] = $tikilib->get_user_preference($nots[$i]['user'], "language", $defaultLanguage);
}
}
if (count($nots)) {
include_once 'lib/webmail/tikimaillib.php';
$mail = new TikiMail();
$smarty->assign('galleryName', $galleryName);
$smarty->assign('mail_date', date("U"));
$smarty->assign('author', $user);
$foo = parse_url($_SERVER["REQUEST_URI"]);
$machine = $tikilib->httpPrefix() . dirname($foo["path"]);
$smarty->assign('mail_machine', $machine);
foreach ($nots as $not) {
$mail->setUser($not['user']);
$mail_data = $smarty->fetchLang($not['language'], "mail/user_watch_file_gallery_changed_subject.tpl");
$mail->setSubject(sprintf($mail_data, $galleryName));
if ($action == 'upload file') {
$mail_data = $smarty->fetchLang($not['language'], "mail/user_watch_file_gallery_upload.tpl");
} elseif ($action == 'remove file') {
$mail_data = $smarty->fetchLang($not['language'], "mail/user_watch_file_gallery_remove_file.tpl");
}
$mail->setText($mail_data);
$mail->buildMessage();
$mail->send(array($not['email']));
}
}
}
示例2: unset
unset($parts[count($parts) - 1]);
}
$smarty->assign('mail_machine_raw', $tikilib->httpPrefix() . implode('/', $parts));
// TODO: mail_machine_site may be required for some sef url with rewrite to sub-directory. To refine. (nkoth)
$smarty->assign('mail_machine_site', $tikilib->httpPrefix());
$mail = new TikiMail();
}
global $prefs;
// TODO: optimise by grouping user by language
$languageEmail = $tikilib->get_user_preference($not['user'], "language", $prefs['site_language']);
$mail->setUser($not['user']);
$mail_data = $smarty->fetchLang($languageEmail, 'mail/user_watch_wiki_page_comment_subject.tpl');
$mail->setSubject(sprintf($mail_data, $_REQUEST["page"]));
$mail_data = $smarty->fetchLang($languageEmail, 'mail/user_watch_wiki_page_comment.tpl');
$mail->setText($mail_data);
$mail->buildMessage();
$mail->send(array($not['email']));
}
}
// redirect back to parent after edit/post to create GET request instead of POST to allow proper bookmarking/refreshing, etc.
if (isset($forum_mode) && $forum_mode == 'y') {
$url = "tiki-view_forum_thread.php?forumId=" . $_REQUEST['forumId'] . "&comments_parentId=" . $_REQUEST['comments_parentId'];
if (!empty($_REQUEST['comments_threshold'])) {
$url .= "&comments_threshold=" . $_REQUEST['comments_threshold'];
}
if (!empty($_REQUEST['comments_offset'])) {
$url .= "&comments_offset=" . $_REQUEST['comments_offset'];
}
if (!empty($_REQUEST['comments_per_page'])) {
$url .= "&comments_per_page=" . $_REQUEST['comments_per_page'];
}
示例3: checkQuota
function checkQuota($size, $galleryId, &$error)
{
global $prefs, $smarty;
$error = '';
if (!empty($prefs['fgal_quota'])) {
$use = $this->getUsedSize();
if ($use + $size > $prefs['fgal_quota'] * 1024 * 1024) {
$error = tra('The upload has not been done.') . ' ' . tra('Reason: The global quota has been reached');
$diff = $use + $size - $prefs['fgal_quota'] * 1024 * 1024;
}
}
if (empty($error) && $prefs['fgal_quota_per_fgal'] == 'y') {
$list = $this->getGalleryParentsColumns($galleryId, array('galleryId', 'quota', 'size', 'name'));
//echo '<pre>';print_r($list);echo '</pre>';
foreach ($list as $fgal) {
if (!empty($fgal['quota']) && $fgal['size'] + $size > $fgal['quota'] * 1024 * 1024) {
$error = tra('The upload has not been done.') . ' ' . sprintf(tra('Reason: The quota has been reached in "%s"'), $fgal['name']);
$smarty->assign('mail_fgal', $fgal);
$diff = $fgal['size'] + $size - $fgal['quota'] * 1024 * 1024;
break;
}
}
}
if (!empty($error)) {
global $tikilib;
$nots = $tikilib->get_event_watches('fgal_quota_exceeded', '*');
if (!empty($nots)) {
include_once 'lib/webmail/tikimaillib.php';
$mail = new TikiMail();
$foo = parse_url($_SERVER["REQUEST_URI"]);
$machine = $tikilib->httpPrefix(true) . dirname($foo["path"]);
$machine = preg_replace("!/\$!", "", $machine);
// just incase
$smarty->assign('mail_machine', $machine);
$smarty->assign('mail_diff', $diff);
foreach ($nots as $not) {
$lg = $tikilib->get_user_preference($not['user'], 'language', $prefs['site_language']);
$mail->setSubject(tra('File gallery quota exceeded', $lg));
$mail->setText($smarty->fetchLang($lg, 'mail/fgal_quota_exceeded.tpl'));
$mail->buildMessage();
$mail->send(array($not['email']));
}
}
return false;
}
return true;
}
示例4: sendStructureEmailNotification
function sendStructureEmailNotification($params)
{
global $tikilib, $smarty, $prefs;
global $structlib;
include_once 'lib/structures/structlib.php';
if ($params['action'] == 'move_up' || $params['action'] == 'move_down') {
$nots = $structlib->get_watches('', $params['parent_id'], false);
} else {
$nots = $structlib->get_watches('', $params['page_ref_id']);
}
if (!empty($nots)) {
$defaultLanguage = $prefs['site_language'];
$foo = parse_url($_SERVER["REQUEST_URI"]);
$machine = $tikilib->httpPrefix() . dirname($foo["path"]);
$smarty->assign_by_ref('mail_machine', $machine);
include_once 'lib/webmail/tikimaillib.php';
$mail = new TikiMail();
$smarty->assign_by_ref('action', $params['action']);
$smarty->assign_by_ref('page_ref_id', $params['page_ref_id']);
if (!empty($params['name'])) {
$smarty->assign('name', $params['name']);
}
foreach ($nots as $not) {
$mail->setUser($not['user']);
$not['language'] = $tikilib->get_user_preference($not['user'], 'language', $defaultLanguage);
$mail_subject = $smarty->fetchLang($not['language'], 'mail/user_watch_structure_subject.tpl');
$mail_data = $smarty->fetchLang($not['language'], 'mail/user_watch_structure.tpl');
$mail->setSubject($mail_subject);
$mail->setText($mail_data);
$mail->buildMessage();
$mail->send(array($not['email']));
}
}
}
示例5: watch
function watch($calitemId, $data)
{
global $tikilib, $smarty, $prefs;
if ($nots = $tikilib->get_event_watches('calendar_changed', $data['calendarId'])) {
include_once 'lib/webmail/tikimaillib.php';
$mail = new TikiMail();
$smarty->assign('mail_new', $new);
$smarty->assign('mail_data', $data);
$smarty->assign('mail_calitemId', $calitemId);
$foo = parse_url($_SERVER["REQUEST_URI"]);
$machine = $tikilib->httpPrefix() . dirname($foo["path"]);
$machine = preg_replace("!/\$!", "", $machine);
// just incase
$smarty->assign('mail_machine', $machine);
$defaultLanguage = $prefs['site_language'];
foreach ($nots as $not) {
$mail->setUser($not['user']);
$mail_data = $smarty->fetchLang($defaultLanguage, "mail/user_watch_calendar_subject.tpl");
$mail->setSubject($mail_data);
$mail_data = $smarty->fetchLang($defaultLanguage, "mail/user_watch_calendar.tpl");
$mail->setText($mail_data);
$mail->buildMessage();
$mail->send(array($not['email']));
}
}
}
示例6: watch
function watch($calitemId, $data)
{
global $tikilib, $smarty, $prefs, $user;
$nots = $tikilib->get_event_watches('calendar_changed', $data['calendarId']);
if ($prefs['feature_daily_report_watches'] == 'y') {
$reportsManager = Reports_Factory::build('Reports_Manager');
$reportsManager->addToCache($nots, array('event' => 'calendar_changed', 'calitemId' => $calitemId, 'user' => $user));
}
if ($nots) {
include_once 'lib/webmail/tikimaillib.php';
$mail = new TikiMail();
$smarty->assign('mail_new', $new);
$smarty->assign('mail_data', $data);
$smarty->assign('mail_calitemId', $calitemId);
$foo = parse_url($_SERVER["REQUEST_URI"]);
$machine = $tikilib->httpPrefix(true) . dirname($foo["path"]);
$machine = preg_replace("!/\$!", "", $machine);
// just incase
$smarty->assign('mail_machine', $machine);
$defaultLanguage = $prefs['site_language'];
foreach ($nots as $not) {
$mail->setUser($not['user']);
$mail_data = $smarty->fetchLang($defaultLanguage, "mail/user_watch_calendar_subject.tpl");
$mail->setSubject($mail_data);
$mail_data = $smarty->fetchLang($defaultLanguage, "mail/user_watch_calendar.tpl");
$mail->setText($mail_data);
$mail->buildMessage();
$mail->send(array($not['email']));
}
}
}
示例7: wikiplugin_tracker
//.........这里部分代码省略.........
}
}
include_once('lib/webmail/tikimaillib.php');
$mail = new TikiMail();
$mail->setHeader('From', $emailOptions[0]);
if (!empty($emailOptions[2])) { //tpl
$emailOptions[2] = preg_split('/ *, */', $emailOptions[2]);
foreach ($emailOptions[2] as $ieo=>$eo) {
if (!preg_match('/\.tpl$/', $eo))
$emailOptions[2][$ieo] = $eo.'.tpl';
$tplSubject[$ieo] = str_replace('.tpl', '_subject.tpl', $emailOptions[2][$ieo]);
}
} else {
$emailOptions[2] = array('tracker_changed_notification.tpl');
}
if (empty($tplSubject)) {
$tplSubject = array('tracker_changed_notification_subject.tpl');
}
$itpl = 0;
$smarty->assign('mail_date', $tikilib->now);
$smarty->assign('mail_itemId', $rid);
foreach ($emailOptions[1] as $ieo=>$ueo) {
@$mail_data = $smarty->fetch('mail/'.$tplSubject[$itpl]);
if (empty($mail_data))
$mail_data = tra('Tracker was modified at '). $_SERVER["SERVER_NAME"];
$mail->setSubject($mail_data);
$mail_data = $smarty->fetch('mail/'.$emailOptions[2][$itpl]);
if ($emailformat == 'html') {
$mail->setHtml($mail_data);
} else {
$mail->setText($mail_data);
}
$mail->buildMessage(array('text_encoding' => '8bit'));
$mail->send($ueo);
if (isset($tplSubject[$itpl+1]))
++$itpl;
}
}
if (empty($url)) {
if (!empty($_REQUEST['ajax_add'])) { // called by tracker ItemLink fields when adding new list items
global $access;
while ( ob_get_level() ) {
ob_end_clean();
}
if ( $prefs['feature_obzip'] == 'y' ) {
ob_start('ob_gzhandler');
} else {
ob_start();
}
// Need to add newly created itemId for item link selector
$ins_fields['itemId'] = $rid;
$access->output_serialized($ins_fields);
ob_end_flush();
die;
} else if (!empty($page)) {
$url = "tiki-index.php?page=".urlencode($page);
if (!empty($itemId)) {
$url .= "&itemId=".$itemId;
}
$url .= "&ok=y&iTRACKER=$iTRACKER";
$url .= "#wikiplugin_tracker$iTRACKER";
header("Location: $url");
exit;
} else {