Exemple #1
0
function mailSchedule(Expo $expo, Worker $worker)
{
    $savList = ShiftAssignmentView::selectWorker($expo->expoid, $worker->workerid);
    $paramNames = array("FIRSTNAME", "EXPONAME");
    $params = array("FIRSTNAME" => $worker->firstName, "EXPONAME" => $expo->title);
    $body = "Hello FIRSTNAME,\n\nYour schedule for EXPONAME is:\n";
    $body .= sprintfSchedule($savList);
    $body .= "\n\nSincerely,\nThe " . SITE_NAME . " Team";
    $form = new FormMail($expo->title . " Schedule", $paramNames, $body);
    $form->sendForm($worker->email, $params);
}
Exemple #2
0
 public static function sendPasswordReset($to, $password)
 {
     // TODO - read subject, params, body from a properties file
     $pwResetForm = new FormMail("Your " . SITE_NAME . " account", array("CODE"), "Your account password has been reset to: CODE");
     $pwResetForm->sendForm($to, array('CODE' => $password));
 }
        logMessage("RegistrationAction", "delete registration for worker:{$worker->workerid} failure " . $ex->getMessage());
        // but ignore and continue
    }
}
// $registration
$expoArray = array();
try {
    $expoArray = Expo::selectMultiple();
} catch (PDOException $ex) {
    logMessage("RegistrationAction", "selecting expo list " . $ex->getMessage());
    // but ignore and continue
}
foreach ($expoArray as $expo) {
    if ($expo->newUserAddedOnRegistration && !$expo->isPast()) {
        if (!$worker->isAssignedToExpo($expo->expoid)) {
            try {
                $worker->assignToExpo($expo->expoid);
            } catch (PDOException $ex) {
                logMessage("RegistrationAction", "assign worker:{$worker->workerid} failure " . $ex->getMessage());
                // but ignore and continue
            }
        }
    }
}
//Send out a confirmation e-mail
$welcomeForm = new FormMail(SITE_NAME . " Registration Confirmation", array("FIRSTNAME", "LOGINURL"), "Hello FIRSTNAME,\nWelcome to " . SITE_NAME . "!\n\n" . "If you forget your password, simply enter your e-mail address on the login page and click the \"Reset Password\" button.\n\n" . "Login Page: LOGINURL." . "\n\nSincerely,\nThe " . SITE_NAME . " Team");
$welcomeForm->sendForm($worker->email, array("FIRSTNAME" => $worker->firstName, "LOGINURL" => LOGIN_URL));
$_SESSION[AUTHENTICATED_TEMP] = $worker;
$_SESSION[AUTHENTICATED] = $worker;
header('Location: WorkerLoginChangePage.php');
include 'WorkerLoginChangePage.php';