Mail Notifications are not sent #33938
-
Description:I have a project with an Account Model that is meant to send a mail Notification
The store method of the AccountsController
The VerifyEmailAddresss Notification class
Mailtrap's config
Steps To Reproduce:I run the following test to create a new account and actual notifications(I am not mocking the notifications) get sent as a side effect.
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
I see that the notification class implements the ShouldQueue Interface |
Beta Was this translation helpful? Give feedback.
-
I test the Notification via a test that tries to create a new account and the notification is a result of that. |
Beta Was this translation helpful? Give feedback.
-
I tried to replicate the action: creating a new account via a route and testing that from the browser and I got the notification. it seems Mail Notifications don't work within a test (I have tried SMS notifications and they do work). |
Beta Was this translation helpful? Give feedback.
-
@seewhy17 have you tried faking your Mail or Notification class in the test itself? Like: Mail::fake() or Notification::fake(). |
Beta Was this translation helpful? Give feedback.
@seewhy17 have you tried faking your Mail or Notification class in the test itself? Like: Mail::fake() or Notification::fake().