Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mail::queue does not work with Laravel Modules #2005

Open
swartjie opened this issue Jan 2, 2025 · 0 comments
Open

Mail::queue does not work with Laravel Modules #2005

swartjie opened this issue Jan 2, 2025 · 0 comments
Labels

Comments

@swartjie
Copy link

swartjie commented Jan 2, 2025

Versions:

  • laravel-modules Version: 11.1.6
  • Laravel Version: 11.34.2
  • PHP Version: 8.3

Description:

I have noticed the Mailable object's build function cannot render the view if it's in a module.
If it's created in the root laravel, it seems to work, and if you send the mail immediately it works.
But if I queue it, the mail fails to send, stating that the view cannot be found.

The issue is, the view is reporting as "local.ERROR: View [emails.register] not found" even though in the class it's defined as "return $this->view('registrer::emails.register');"

Calling the class as "Mail::to($user->email)->send(new RegisterEmail($data));" works, while doing the same as a queued item "Mail::to($user->email)->queue(new RegisterEmail($data));" does not, Complaining about the view not being found.

Steps To Reproduce:

Create a mail object using the command "php artisan module:make-mail" and queue a mail to be sent.

@swartjie swartjie added the bug label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant