1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-30 11:20:25 +02:00

Cron Test email function updated to use new mailing method.

This commit is contained in:
Cameron
2016-02-07 23:35:38 -08:00
parent cff27bf17a
commit 706e79af1f
3 changed files with 60 additions and 7 deletions

View File

@@ -167,12 +167,63 @@ class _system_cron
global $pref, $_E107;
if($_E107['debug']) { echo "<br />sendEmail() executed"; }
require_once(e_HANDLER.'mail.php');
$message = "Your Cron test worked correctly. Sent at ".date("r").".";
// require_once(e_HANDLER.'mail.php');
$message = "Your Cron test worked correctly. Sent on ".date("r").".";
sendemail($pref['siteadminemail'], "e107 - TEST Email Sent by cron.".date("r"), $message, $pref['siteadmin'],$pref['siteadminemail'], $pref['siteadmin']);
$message .= "<h2>Environment Variables</h2>";
$userCon = get_defined_constants(true);
ksort($userCon['user']);
$userVars = array();
foreach($userCon['user'] as $k=>$v)
{
if(substr($k,0,2) == 'e_')
{
$userVars[$k] = $v;
}
}
$message .= "<h3>e107 PATHS</h3>";
$message .= $this->renderTable($userVars);
$message .= "<h3>_SERVER</h3>";
$message .= $this->renderTable($_SERVER);
$message .= "<h3>_ENV</h3>";
$message .= $this->renderTable($_ENV);
$eml = array(
'subject' => "TEST Email Sent by cron. ".date("r"),
// 'sender_email' => $email,
'sender_name' => SITENAME . " Automation",
// 'replyto' => $email,
'html' => true,
'template' => 'default',
'body' => $message
);
e107::getEmail()->sendEmail($pref['siteadminemail'], $pref['siteadmin'], $eml);
// sendemail($pref['siteadminemail'], "e107 - TEST Email Sent by cron.".date("r"), $message, $pref['siteadmin'],SITEEMAIL, $pref['siteadmin']);
}
private function renderTable($array)
{
$text = "<table class='table table-striped table-bordered' style='width:600px'>";
foreach($array as $k=>$v)
{
$text .= "<tr>
<td>".$k."</td>
<td>".print_a($v,true)."</td>
</tr>
";
}
$text .= "</table>";
return $text;
}
/**
* Process the Mail Queue

View File

@@ -30,7 +30,7 @@ class list_forum
{ // New posts since last visit, up to limit
$lvisit = $this->parent->getlvisit();
$qry = "
SELECT tp.thread_name AS parent_name, tp.thread_id as parent_id,
SELECT t.thread_name AS parent_name, t.thread_id as parent_id,
f.forum_id, f.forum_name, f.forum_class,
u.user_name, lp.user_name AS lp_name,
t.thread_id, t.thread_views as tviews, t.thread_name, t.thread_datestamp, t.thread_user,
@@ -43,6 +43,7 @@ class list_forum
WHERE find_in_set(forum_class, '".USERCLASS_LIST."')
AND t.thread_lastpost > {$lvisit}
ORDER BY tp.post_datestamp DESC LIMIT 0,".intval($this->parent->settings['amount']);
}
else
{ // Most recently updated threads up to limit

View File

@@ -45,9 +45,10 @@ $rc->mode = "new_menu";
$text = $rc->displayMenu();
$caption = vartrue($rc->list_pref[$rc->mode."_caption"], LIST_MENU_1);
$caption = $rc->e107->tp->toHtml($caption, FALSE, 'USER_TITLE');
$text = $rc->e107->tp->toHtml($text, TRUE, 'USER_BODY');
$rc->e107->ns->tablerender($caption, $text, 'list_new');
$caption = e107::getParser()->toHtml($caption, FALSE, 'USER_TITLE');
$text = e107::getParser()->toHtml($text, TRUE, 'USER_BODY');
e107::getRender()->tablerender($caption, $text, 'list_new');
unset($caption);
unset($text);