Confirm Status Message

This commit is contained in:
cgfhtw
2024-07-31 09:45:20 +02:00
parent 3d27c68dee
commit 009360a127
@@ -1844,6 +1844,48 @@ class Status extends FHCAPI_Controller
$this->getDataOrTerminateWithError($result);
//Send Message
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
$this->PrestudentModel->addSelect('p.*');
$this->PrestudentModel->addSelect('stg.oe_kurzbz');
$this->PrestudentModel->addSelect('stg.bezeichnung AS stg_bezeichnung');
$this->PrestudentModel->addSelect('stg.email AS stg_email');
$this->PrestudentModel->addSelect('plan.orgform_kurzbz');
$this->PrestudentModel->addSelect('typ.bezeichnung AS typ_bezeichnung');
$this->PrestudentModel->addJoin('public.tbl_person p', 'person_id');
$this->PrestudentModel->addJoin('public.tbl_studiengang stg', 'studiengang_kz');
$this->PrestudentModel->addJoin('public.tbl_studiengangstyp typ', 'typ');
$this->PrestudentModel->addJoin('public.tbl_studienplan plan', 'studienplan_id', 'LEFT');
$result = $this->PrestudentModel->load($prestudent_id);
$studentdata = $this->getDataOrTerminateWithError($result);
$this->load->library('MessageLib');
$result = $this->messagelib->sendMessageUserTemplate(
$studentdata->person_id, // receiversPersonId
'MailStatConfirm' . $status_kurzbz, // vorlage
[
'anrede' => $studentdata->anrede,
'vorname' => $studentdata->vorname,
'nachname' => $studentdata->nachname,
'typ' => $studentdata->typ_bezeichnung,
'studiengang' => $studentdata->stg_bezeichnung,
'orgform' => $studentdata->orgform_kurzbz ?: $oldstatus->orgform_kurzbz,
'stgMail' => $studentdata->stg_email
], // parseData
null, // orgform
1, // TODO
$studentdata->oe_kurzbz, // senderOU
null, // relationmessage_id
MSG_PRIORITY_NORMAL, // priority
true // multiPartMime
);
$this->terminateWithSuccess(true);
}