예제 #1
0
    $app->redirect('http://northcreek.ca/stratum/launch.html');
});
$app->get('/launchForm', function (Request $request, Response $response) use($log) {
    // this is all the happy path assuming everything is set up properly from the Bullhorn side
    //load the id from the request
    $id = $request->getAttribute('entityid');
    //set up the controllers and their loggers
    $wcontroller = new \Stratum\Controller\WorldappController();
    $bcontroller = new \Stratum\Controller\BullhornController();
    $bcontroller->setLogger($log);
    $wcontroller->setLogger($log);
    //find the correct form
    $form = $wcontroller->find_form_by_name('Registration Form - Stratum International');
    //load the candidate data from Bullhorn
    $candidate = new Stratum\Model\Candidate();
    $candidate->set("id", $id);
    $bcontroller->load($candidate);
    //find the corporateUser Owner of this candidate (for From and ReplyTo email address)
    $ownerId = $candidate->get("owner")["id"];
    $owner = new \Stratum\Model\CorporateUser();
    $owner->set("id", $ownerId);
    $bcontroller->loadCorporateUser($owner);
    //load the custom Object that contains the template information
    $obj = $this->candidate->loadCustomObject(3);
    //download and store the original template (so we can convert back)
    $emailTemplate = $wcontroller->getEmailTemplate($form->id);
    //set up the correct template
    $newTemplate = [];
    $newTemplate['formId'] = $form->id;
    $newTemplate['from'] = $owner->get("email");
    $newTemplate['replyTo'] = $owner->get("email");
예제 #2
0
 public function updateCandidateStatus($candidate, $status)
 {
     $bullhornClient = $this->getClient();
     $dummy = new \Stratum\Model\Candidate();
     $dummy->set("id", $candidate->get("id"));
     $dummy->set("preferredContact", $status);
     $decoded = $bullhornClient->update_candidate($dummy);
 }