Spree Multi Tenant Configuration
Multi-tenant applications include additional configuration options. All configuration should be placed in config/initializers/spree_multi_tenant.rb
file.
Root domain
To make multi-tenant, you need a root/wildcard domain, eg. *.example.com
. Tenant stores are usually accessed via subdomains, eg. store1.example.com
, store2.example.com
, etc.
Still your tenants will be able to add custom domains, eg. myflowerstore.com
via the Spree admin panel. Tenant subdomains are used only for admin panel access.
App subdomain
Application subdomains is used to access the application, eg. app.example.com
. By default for existing tenants it will redirect them to their tenant subdomain, eg. store1.example.com
. If you want, you can also use this as a tenant signup/store setup page, this is available under app.example.com/tenants/new
.
You can customize the app subdomain by:
This will change app.example.com
to admin.example.com
.
Emails
Usually email providers, such as SendGrid, require emails to be send from a valid / verified email address, which will be your root domain.
mail_from_name
is only used in admin emails, such as admin staff invitations, exports, etc. For consumer facing emails, this will be your tenant store name, eg. ‘My Flower Store` (or whatever they set in the store settings).
Also, customer facing emails will use the tenant email address in Reply-To
header.