/** * Given an email address, mark it as invalid. * * @param $email_address */ function markEmailAddressInvalid($email_address) { if (empty($email_address)) { return; } $sea = new SugarEmailAddress(); $rs = $sea->retrieve_by_string_fields(array('email_address_caps' => trim(strtoupper($email_address)))); if ($rs != null) { $sea->AddUpdateEmailAddress($email_address, 1, 0, $rs->id); } }
$lead->campaigns->add($camplog->id); if (!empty($GLOBALS['check_notify'])) { $lead->save($GLOBALS['check_notify']); } else { $lead->save(FALSE); } } //in case there are forms out there still using email_opt_out if (isset($_POST['webtolead_email_opt_out']) || isset($_POST['email_opt_out'])) { if (isset($lead->email1) && !empty($lead->email1)) { $sea = new SugarEmailAddress(); $sea->AddUpdateEmailAddress($lead->email1, 0, 1); } if (isset($lead->email2) && !empty($lead->email2)) { $sea = new SugarEmailAddress(); $sea->AddUpdateEmailAddress($lead->email2, 0, 1); } } if (isset($_POST['redirect_url']) && !empty($_POST['redirect_url'])) { // Get the redirect url, and make sure the query string is not too long $redirect_url = $_POST['redirect_url']; $query_string = ''; $first_char = '&'; if (strpos($redirect_url, '?') === FALSE) { $first_char = '?'; } $first_iteration = true; $get_and_post = array_merge($_GET, $_POST); foreach ($get_and_post as $param => $value) { if ($param == 'redirect_url' || $param == 'submit') { continue;
if (!empty($GLOBALS['check_notify'])) { $person->save($GLOBALS['check_notify']); } else { $person->save(false); } } //in case there are forms out there still using email_opt_out if (isset($_POST['webtolead_email_opt_out']) || isset($_POST['email_opt_out'])) { if (isset($person->email1) && !empty($person->email1)) { $sea = new SugarEmailAddress(); $sea->AddUpdateEmailAddress($person->email1, 0, 1); } if (isset($person->email2) && !empty($person->email2)) { $sea = new SugarEmailAddress(); $sea->AddUpdateEmailAddress($person->email2, 0, 1); } } if (isset($_POST['redirect_url']) && !empty($_POST['redirect_url'])) { // Get the redirect url, and make sure the query string is not too long $redirect_url = $_POST['redirect_url']; $query_string = ''; $first_char = '&'; if (strpos($redirect_url, '?') === false) { $first_char = '?'; } $first_iteration = true; $get_and_post = array_merge($_GET, $_POST); foreach ($get_and_post as $param => $value) { if ($param == 'redirect_url' && $param == 'submit') { continue;