|
@@ -404,58 +404,67 @@ |
404 |
404 |
|
$disableSms = false |
405 |
405 |
|
) |
406 |
406 |
|
{ |
407 |
|
- |
if (IS_BROCHURE) |
408 |
|
- |
{ |
409 |
|
- |
self::send( |
|
407 |
+ |
//problem with GearmanClient so i'm just using normal send for now |
|
408 |
+ |
self::send( |
410 |
409 |
|
$fromCompanyId, $fromProfileId, |
411 |
410 |
|
$toCompanyId, $toProfileId, $email, $mobile, |
412 |
411 |
|
$subject, $emailTemplate, $smsTemplate, |
413 |
412 |
|
$attachments, $complexAttachments, $disableSms |
414 |
413 |
|
); |
415 |
|
- |
} |
416 |
|
- |
else |
417 |
|
- |
{ |
418 |
|
- |
$id = 'n' . microtime(true); |
419 |
|
- |
while (\Utility\FileStore::existsJson($id)) |
420 |
|
- |
{ |
421 |
|
- |
time_nanosleep(0, 1000); |
422 |
|
- |
$id = 'n' . microtime(true); |
423 |
|
- |
}; |
424 |
|
- |
foreach ($attachments as $key => $data) |
425 |
|
- |
{ |
426 |
|
- |
$attachments[$key] = utf8_encode($data); |
427 |
|
- |
} |
428 |
|
- |
foreach ($complexAttachments as $key => $data) |
429 |
|
- |
{ |
430 |
|
- |
$complexAttachments[$key] = utf8_encode($data); |
431 |
|
- |
} |
432 |
|
- |
\Utility\FileStore::storeJson( |
433 |
|
- |
$id, |
434 |
|
- |
array( |
435 |
|
- |
'fromCompanyId' => $fromCompanyId, |
436 |
|
- |
'fromProfileId' => $fromProfileId, |
437 |
|
- |
'toCompanyId' => $toCompanyId, |
438 |
|
- |
'toProfileId' => $toProfileId, |
439 |
|
- |
'email' => $email, |
440 |
|
- |
'mobile' => $mobile, |
441 |
|
- |
'subject' => $subject, |
442 |
|
- |
'emailTemplate' => $emailTemplate, |
443 |
|
- |
'smsTemplate' => $smsTemplate, |
444 |
|
- |
'attachments' => $attachments, |
445 |
|
- |
'complexAttachments' => $complexAttachments, |
446 |
|
- |
'disableSms' => $disableSms |
447 |
|
- |
) |
448 |
|
- |
); |
449 |
|
- |
if (false === self::$_gearClient) |
450 |
|
- |
{ |
451 |
|
- |
self::$_gearClient = new \GearmanClient(); |
452 |
|
- |
self::$_gearClient->addServer(); |
453 |
|
- |
} |
454 |
|
- |
self::$_gearClient->doBackground( |
455 |
|
- |
'Notify', |
456 |
|
- |
$id |
457 |
|
- |
); |
458 |
|
- |
} |
|
414 |
+ |
|
|
415 |
+ |
// if (IS_BROCHURE) |
|
416 |
+ |
// { |
|
417 |
+ |
// self::send( |
|
418 |
+ |
// $fromCompanyId, $fromProfileId, |
|
419 |
+ |
// $toCompanyId, $toProfileId, $email, $mobile, |
|
420 |
+ |
// $subject, $emailTemplate, $smsTemplate, |
|
421 |
+ |
// $attachments, $complexAttachments, $disableSms |
|
422 |
+ |
// ); |
|
423 |
+ |
// } |
|
424 |
+ |
// else |
|
425 |
+ |
// { |
|
426 |
+ |
// $id = 'n' . microtime(true); |
|
427 |
+ |
// while (\Utility\FileStore::existsJson($id)) |
|
428 |
+ |
// { |
|
429 |
+ |
// time_nanosleep(0, 1000); |
|
430 |
+ |
// $id = 'n' . microtime(true); |
|
431 |
+ |
// }; |
|
432 |
+ |
// foreach ($attachments as $key => $data) |
|
433 |
+ |
// { |
|
434 |
+ |
// $attachments[$key] = utf8_encode($data); |
|
435 |
+ |
// } |
|
436 |
+ |
// foreach ($complexAttachments as $key => $data) |
|
437 |
+ |
// { |
|
438 |
+ |
// $complexAttachments[$key] = utf8_encode($data); |
|
439 |
+ |
// } |
|
440 |
+ |
// \Utility\FileStore::storeJson( |
|
441 |
+ |
// $id, |
|
442 |
+ |
// array( |
|
443 |
+ |
// 'fromCompanyId' => $fromCompanyId, |
|
444 |
+ |
// 'fromProfileId' => $fromProfileId, |
|
445 |
+ |
// 'toCompanyId' => $toCompanyId, |
|
446 |
+ |
// 'toProfileId' => $toProfileId, |
|
447 |
+ |
// 'email' => $email, |
|
448 |
+ |
// 'mobile' => $mobile, |
|
449 |
+ |
// 'subject' => $subject, |
|
450 |
+ |
// 'emailTemplate' => $emailTemplate, |
|
451 |
+ |
// 'smsTemplate' => $smsTemplate, |
|
452 |
+ |
// 'attachments' => $attachments, |
|
453 |
+ |
// 'complexAttachments' => $complexAttachments, |
|
454 |
+ |
// 'disableSms' => $disableSms |
|
455 |
+ |
// ) |
|
456 |
+ |
// ); |
|
457 |
+ |
// if (false === self::$_gearClient) |
|
458 |
+ |
// { |
|
459 |
+ |
// self::$_gearClient = new GearmanClient(); |
|
460 |
+ |
// self::$_gearClient->addServer(); |
|
461 |
+ |
// } |
|
462 |
+ |
// $job_handle=self::$_gearClient->doBackground( |
|
463 |
+ |
// 'Notify', |
|
464 |
+ |
// $id |
|
465 |
+ |
// ); |
|
466 |
+ |
// |
|
467 |
+ |
// } |
459 |
468 |
|
} |
460 |
469 |
|
|
461 |
470 |
|
|