diff --git a/common/framework/Mail.php b/common/framework/Mail.php index bcf9b62a3..72c226c95 100644 --- a/common/framework/Mail.php +++ b/common/framework/Mail.php @@ -556,12 +556,13 @@ class Mail /** * Send the email. * + * @param bool $sync * @return bool */ - public function send(): bool + public function send(bool $sync = false): bool { // If queue is enabled, send asynchronously. - if (config('queue.enabled') && !defined('RXQUEUE_CRON')) + if (!$sync && config('queue.enabled') && !defined('RXQUEUE_CRON')) { Queue::addTask(self::class . '::' . 'sendAsync', $this); return true; diff --git a/common/framework/Push.php b/common/framework/Push.php index bc37cd2c7..be8f7b0c2 100644 --- a/common/framework/Push.php +++ b/common/framework/Push.php @@ -398,12 +398,13 @@ class Push /** * Send the message. * + * @param bool $sync * @return bool */ - public function send(): bool + public function send(bool $sync = false): bool { // If queue is enabled, send asynchronously. - if (config('queue.enabled') && !defined('RXQUEUE_CRON')) + if (!$sync && config('queue.enabled') && !defined('RXQUEUE_CRON')) { Queue::addTask(self::class . '::' . 'sendAsync', $this); return true; diff --git a/common/framework/SMS.php b/common/framework/SMS.php index 4bb65fd60..7f9da9f5d 100644 --- a/common/framework/SMS.php +++ b/common/framework/SMS.php @@ -507,12 +507,13 @@ class SMS /** * Send the message. * + * @param bool $sync * @return bool */ - public function send(): bool + public function send(bool $sync = false): bool { // If queue is enabled, send asynchronously. - if (config('queue.enabled') && !defined('RXQUEUE_CRON')) + if (!$sync && config('queue.enabled') && !defined('RXQUEUE_CRON')) { Queue::addTask(self::class . '::' . 'sendAsync', $this); return true;