You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: mail.md
+27Lines changed: 27 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1076,6 +1076,33 @@ class OrderShipped extends Mailable implements ShouldQueue
1076
1076
> [!NOTE]
1077
1077
> To learn more about working around these issues, please review the documentation regarding [queued jobs and database transactions](/docs/{{version}}/queues#jobs-and-database-transactions).
1078
1078
1079
+
<aname="queued-email-failures"></a>
1080
+
#### Queued Email Failures
1081
+
1082
+
When a queued email fails, the `failed` method on the queued mailable class will be invoked if it has been defined. The `Throwable` instance that caused the queued email to fail will be passed to the `failed` method:
1083
+
1084
+
```php
1085
+
<?php
1086
+
1087
+
namespace App\Mail;
1088
+
1089
+
use Illuminate\Contracts\Queue\ShouldQueue;
1090
+
use Illuminate\Mail\Mailable;
1091
+
use Illuminate\Queue\SerializesModels;
1092
+
use Throwable;
1093
+
1094
+
class OrderDelayed extends Mailable implements ShouldQueue
1095
+
{
1096
+
/**
1097
+
* Handle a queued email's failure.
1098
+
*/
1099
+
public function failed(Throwable $exception): void
0 commit comments