mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Add $sync parameter to send() method of Mail, SMS and Push classes #2402
This commit is contained in:
parent
7e9dd8f297
commit
b6c444c536
3 changed files with 9 additions and 6 deletions
|
|
@ -556,12 +556,13 @@ class Mail
|
||||||
/**
|
/**
|
||||||
* Send the email.
|
* Send the email.
|
||||||
*
|
*
|
||||||
|
* @param bool $sync
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function send(): bool
|
public function send(bool $sync = false): bool
|
||||||
{
|
{
|
||||||
// If queue is enabled, send asynchronously.
|
// 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);
|
Queue::addTask(self::class . '::' . 'sendAsync', $this);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -398,12 +398,13 @@ class Push
|
||||||
/**
|
/**
|
||||||
* Send the message.
|
* Send the message.
|
||||||
*
|
*
|
||||||
|
* @param bool $sync
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function send(): bool
|
public function send(bool $sync = false): bool
|
||||||
{
|
{
|
||||||
// If queue is enabled, send asynchronously.
|
// 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);
|
Queue::addTask(self::class . '::' . 'sendAsync', $this);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -507,12 +507,13 @@ class SMS
|
||||||
/**
|
/**
|
||||||
* Send the message.
|
* Send the message.
|
||||||
*
|
*
|
||||||
|
* @param bool $sync
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function send(): bool
|
public function send(bool $sync = false): bool
|
||||||
{
|
{
|
||||||
// If queue is enabled, send asynchronously.
|
// 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);
|
Queue::addTask(self::class . '::' . 'sendAsync', $this);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue