X-Git-Url: https://xp-dev.com/git/namibia/blobdiff_plain/da65b17bf1eab0ee9bcbc9b57e07a3465e49bf55..3a6b5be7d9bca386db37fb975448f4d96d0e20ad:/module/Utility/src/Utility/Comms/Notification.php diff --git a/module/Utility/src/Utility/Comms/Notification.php b/module/Utility/src/Utility/Comms/Notification.php index 1b36c36..93be2c1 100644 --- a/module/Utility/src/Utility/Comms/Notification.php +++ b/module/Utility/src/Utility/Comms/Notification.php @@ -404,58 +404,67 @@ class Notification $disableSms = false ) { - if (IS_BROCHURE) - { - self::send( + //problem with GearmanClient so i'm just using normal send for now + self::send( $fromCompanyId, $fromProfileId, $toCompanyId, $toProfileId, $email, $mobile, $subject, $emailTemplate, $smsTemplate, $attachments, $complexAttachments, $disableSms ); - } - else - { - $id = 'n' . microtime(true); - while (\Utility\FileStore::existsJson($id)) - { - time_nanosleep(0, 1000); - $id = 'n' . microtime(true); - }; - foreach ($attachments as $key => $data) - { - $attachments[$key] = utf8_encode($data); - } - foreach ($complexAttachments as $key => $data) - { - $complexAttachments[$key] = utf8_encode($data); - } - \Utility\FileStore::storeJson( - $id, - array( - 'fromCompanyId' => $fromCompanyId, - 'fromProfileId' => $fromProfileId, - 'toCompanyId' => $toCompanyId, - 'toProfileId' => $toProfileId, - 'email' => $email, - 'mobile' => $mobile, - 'subject' => $subject, - 'emailTemplate' => $emailTemplate, - 'smsTemplate' => $smsTemplate, - 'attachments' => $attachments, - 'complexAttachments' => $complexAttachments, - 'disableSms' => $disableSms - ) - ); - if (false === self::$_gearClient) - { - self::$_gearClient = new \GearmanClient(); - self::$_gearClient->addServer(); - } - self::$_gearClient->doBackground( - 'Notify', - $id - ); - } + +// if (IS_BROCHURE) +// { +// self::send( +// $fromCompanyId, $fromProfileId, +// $toCompanyId, $toProfileId, $email, $mobile, +// $subject, $emailTemplate, $smsTemplate, +// $attachments, $complexAttachments, $disableSms +// ); +// } +// else +// { +// $id = 'n' . microtime(true); +// while (\Utility\FileStore::existsJson($id)) +// { +// time_nanosleep(0, 1000); +// $id = 'n' . microtime(true); +// }; +// foreach ($attachments as $key => $data) +// { +// $attachments[$key] = utf8_encode($data); +// } +// foreach ($complexAttachments as $key => $data) +// { +// $complexAttachments[$key] = utf8_encode($data); +// } +// \Utility\FileStore::storeJson( +// $id, +// array( +// 'fromCompanyId' => $fromCompanyId, +// 'fromProfileId' => $fromProfileId, +// 'toCompanyId' => $toCompanyId, +// 'toProfileId' => $toProfileId, +// 'email' => $email, +// 'mobile' => $mobile, +// 'subject' => $subject, +// 'emailTemplate' => $emailTemplate, +// 'smsTemplate' => $smsTemplate, +// 'attachments' => $attachments, +// 'complexAttachments' => $complexAttachments, +// 'disableSms' => $disableSms +// ) +// ); +// if (false === self::$_gearClient) +// { +// self::$_gearClient = new GearmanClient(); +// self::$_gearClient->addServer(); +// } +// $job_handle=self::$_gearClient->doBackground( +// 'Notify', +// $id +// ); +// +// } }