//Prep CANVAS query
// using "if ($today == date ('Y-m-d')){ " (if water is wet, sky is blue..) to test
1. Added alert function in sugar_3.js
HTML Code:
function periodAlert(){
var r=confirm("Time to Send Canvas Email")
if (r==true)
{
window.location = 'index.php?action=DetailView&module=Campaigns&action=index'
}
} 2. Added function in jsAlerts.php below addAlerts
PHP Code:
function periodAlert(){
$this->script .= 'periodAlert()' . "\n";
}
3. Added "//Prep MyQuery between // Prep Meetings Query & // Prep Calls Query (also jsAlerts.php)
PHP Code:
if ($today == date ('Y-m-d')){
$period_time_end = $timedate->handle_offset(date("Y-m-d H:"), $timedate->dbDayFormat, false);
$select_emailman = " SELECT id, deleted FROM emailman WHERE id !='' AND deleted !=1 ";
$result = mysql_query($select_emailman)or die ("Query failed - select_emailman"); // Run the query.
$numresults=mysql_query($select_emailman);
$numrows=mysql_num_rows($numresults);
// If we have no results, periodAlert
if (!isset($_SESSION['alertTime']))
$_SESSION['alertTime'] = 0;
if ($numrows == 0 && time() > ($_SESSION['alertTime'] + (5*60))){
$this->periodAlert(); $_SESSION['alertTime'] = time();
}
}
When the end of our marketing periods roll around, we now get an alert every five minutes reminding us to Send Canvas Email Campaign if there are no current emails queud in emailman.
Bookmarks