-
-
Notifications
You must be signed in to change notification settings - Fork 431
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
Route helper in job doesn't use tenant context domain #1218
Comments
This isn't done by the package automatically because there's no way for the package to know what the correct domain is:
You should manually update We've added a bootstrapper for this in v4 but it still requires configuration due to the reasons above. |
Could we add a primary domain config somewhere, maybe as extra column in the domains table? |
Yes, you can do that. It's up to you how you approach this, the right solution here will be application-specific. |
Ok, might be a common use case, anyway I'll handle it. Thanks for the super fast reply! |
In v4 we've added:
In the SaaS boilerplate we use this primary domain concept. iirc it's a The package won't ship with primary domains out of the box since they only make sense when you really do need multiple domains and have some UI for letting the tenant manage their domains. But the changes we've made should add a good default implementation for this use case. |
Bug description
I am sending an email in a job and I am passing to the template an url using the
route
helper. The email is sent with the central domain instead of the tenant context domain.Logging
tenancy()->tenant
shows that the tenant is correct so I guess the tenant is initialized?My setup is using multi database tenancy
My bootstrappers:
Steps to reproduce
Dispatch a job from a tenant context and log any route using the route helper.
The job class handle method
Logs in the laravel.log file:
Expected behavior
As tenancy()->tenant has the correct tennat I would expect the route helper to use the tenant domain.
Laravel version
10.48.7
stancl/tenancy version
v3.8.1
The text was updated successfully, but these errors were encountered: