docs/developer/multi-tenant/configuration.mdx
Multi-tenant applications include additional configuration options. All configuration should be placed in config/initializers/spree_multi_tenant.rb file.
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.
Spree.root_domain = 'example.com'
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.
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:
SpreeMultiTenant::Config[:app_subdomain] = 'admin'
This will change app.example.com to admin.example.com.
Usually email providers, such as SendGrid, require emails to be send from a valid / verified email address, which will be your root domain.
SpreeMultiTenant::Config[:mail_from_name] = ENV.fetch('MAIL_FROM_NAME', 'Your SaaS Name')
SpreeMultiTenant::Config[:mail_from_address] = ENV.fetch('MAIL_FROM_ADDRESS', "support@#{Spree.root_domain}")
Also, customer facing emails will use the tenant email address in Reply-To header.
</Info>