CodeCharge Studioglobal $DBIntranetDB;
global $tasks;
if (CCGetUserID() != $tasks->user_id_assign_to->GetValue())
{
$from_name = CCDLookUp("emp_name", "employees", "emp_id=".
$DBIntranetDB->ToSQL(CCGetUserID(), ccsInteger), $DBIntranetDB);
$from_email = CCDLookUp("email", "employees", "emp_id=".
$DBIntranetDB->ToSQL(CCGetUserID(), ccsInteger), $DBIntranetDB);
$to_email = CCDLookUp("email", "employees", "emp_id=".
$DBIntranetDB->ToSQL($tasks->user_id_assign_to->GetValue(),ccsInteger), $DBIntranetDB);
$headers = "From: ".$from_name."<".$from_email.">;\r\n";
$headers .= "Content-Type: text/html;";
$subject = "A task was assigned to you";
$message = "The following task was assigned to you:<br><br>".
"Task ID: ".CCGetFromGet ("task_id", " " )."<br><br>".
$tasks->task_desc->GetText();
mail($to_email, $subject, $message, $headers);
}
The main differences between the above code and that which was used in the After Insert event are as follows:
http://localhost/TaskManager/tasks_maint.php?task_id=9
Next: Test Email Delivery