Fixed Bug where wrong Messages are sent if they are not sent immediately

Messages are only sent with the Employee-Adress of the Sender instead of
the private Address. If the Sender is not an Employee, the Messages are
sent with the System-EMail
This commit is contained in:
Andreas Österreicher
2018-02-21 23:27:24 +01:00
parent b86aaf735c
commit 45485ee02a
4 changed files with 36 additions and 23 deletions
@@ -261,6 +261,7 @@ class Recipient_model extends DB_Model
ks.kontakt as sender,
kr.kontakt as receiver,
mu.mitarbeiter_uid as employeeContact,
ms.mitarbeiter_uid as senderemployeeContact,
mr.person_id as receiver_id,
mr.token,
mm.subject,
@@ -278,7 +279,13 @@ class Recipient_model extends DB_Model
m.mitarbeiter_uid
FROM public.tbl_benutzer b INNER JOIN public.tbl_mitarbeiter m ON(b.uid = m.mitarbeiter_uid)
WHERE b.aktiv = TRUE
) mu ON (mu.person_id = mr.person_id)';
) mu ON (mu.person_id = mr.person_id)
LEFT JOIN (
SELECT b.person_id,
m.mitarbeiter_uid
FROM public.tbl_benutzer b INNER JOIN public.tbl_mitarbeiter m ON(b.uid = m.mitarbeiter_uid)
WHERE b.aktiv = TRUE
) ms ON (ms.person_id = mm.person_id)';
$parametersArray = array($kontaktType, $kontaktType);