Skip to content

Queued notification not delivering #56553

@aphoe

Description

@aphoe

Laravel Version

12.21

PHP Version

8.3

Database Driver & Version

No response

Description

I am trying to switch notifications to use queue. I have implemented the ShouldQueue interface and added the Queueable trait to the notification class.

No matter which QUEUE_CONNECTION I use, the job is processed successfully but the mail doesn't get sent.

Now the same mail gets sent and delivered successfully when I comment out the interface and the trait.

I added \Log::info() to the constructor and the toMail() method of the notification class. I can see the log message from the constructor in the logs but not that of the toMail() method.

I created a job to send the notification and added log messages to job's handle() method. One before and one after the notification calling statements. When the notification class does not enable queue (the interface and trait), the notification gets sent and delivered.

But when I enabled queueing, it does not send mail. I get the log message from the notification class constructor but not from the toMail() method.

PS: I upgraded this code from Laravel 11
PPS: I have tested this with MailPit and a third-party transaction mail service

Steps To Reproduce

Create a new Laravel project, create a notification class with queue enabled, and test.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions