Skip to content

Commit

Permalink
Merge pull request #28484 from arxeiss/retryAfterToNotificationsAndMa…
Browse files Browse the repository at this point in the history
…ilable

[5.8] Add retryAfter in Notification and Mailable object
  • Loading branch information
taylorotwell authored May 11, 2019
2 parents b4c0ef1 + 79ae5d6 commit 08f2555
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Illuminate/Mail/SendQueuedMailable.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@ public function failed($e)
}
}

/**
* Get the retry delay for the mailable object.
*
* @return mixed
*/
public function retryAfter()
{
if (! method_exists($this->mailable, 'retryAfter') && ! isset($this->mailable->retryAfter)) {
return;
}

return $this->mailable->retryAfter ?? $this->mailable->retryAfter();
}

/**
* Prepare the instance for cloning.
*
Expand Down
14 changes: 14 additions & 0 deletions src/Illuminate/Notifications/SendQueuedNotifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,20 @@ public function failed($e)
}
}

/**
* Get the retry delay for the notification.
*
* @return mixed
*/
public function retryAfter()
{
if (! method_exists($this->notification, 'retryAfter') && ! isset($this->notification->retryAfter)) {
return;
}

return $this->notification->retryAfter ?? $this->notification->retryAfter();
}

/**
* Prepare the instance for cloning.
*
Expand Down

0 comments on commit 08f2555

Please sign in to comment.