I have a page that sends e-mails based on a date field changing. At first when I only had the 1 e-mail action, if the field PP_S2_Date changed, then an e-mail went. So I added if either of the dates change, and now I get 2 e-mails sent every time someone saves the record whether a change to those fields occurred or not. I'm new to PHP and SQL, and I'm trying to begin my education on them. ie i just bought Learning PHP & MySQL, Second Edition by O'Reilly so please be a little patient with me =] Below is the code that I have that is not working. I just had the single code with the 1 e-mail command, and I'm trying to add the 2nd. All help is greatly appreciated
if ($oldvalues["PP_S2_DATE"] != $values["PP_S2_DATE"]) {
// ********** Send simple email ************
$email="jbarreras@srdcommercial.com";
$from="contact@saundersrealestate.com";
$msg="Please begin to process the ".$values["Marketing Title"]." listing. ".$values["Listing Agent"]." has completed the Listing Inofrmation Sheet and the project is now ready to begin the marketing process";
$subject="New Listing: ".$values["Marketing Title"];
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, 'from'=>$from));
if(!$ret["mailed"])
echo $ret["message"];
if ($oldvalues["PP_S35_DATE"] != $values["PP_S35_DATE"]) {
// ********** Send simple email ************
$email="jbarreras@srdcommercial.com";
$from="contact@saundersrealestate.com";
$msg="Price Change ".$values["Marketing Title"]." listing. ".$values["Listing Agent"]." has updated the price. Please begin the Price Change Protocol";
$subject="Price Change: ".$values["Marketing Title"];
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, 'from'=>$from));
if(!$ret["mailed"])
echo $ret["message"];
}}


