Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
[Skip CI] update multi tenant documentation
Damian Legawiec745c13f4b77f
diff --git a/docs/developer/multi-tenant/configuration.mdx b/docs/developer/multi-tenant/configuration.mdxnew file mode 100644index 0000000000..dd79cd719e--- /dev/null+++ b/docs/developer/multi-tenant/configuration.mdx@@ -0,0 +1,43 @@+---+title: Spree Multi Tenant Configuration+sidebarTitle: 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.++```bash+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.++### 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:++```ruby+SpreeMultiTenant::Config[:app_subdomain] = 'admin'+```++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.++```ruby+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}")+```++<Info>+`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.+</Info>\ No newline at end of filediff --git a/docs/developer/multi-tenant/quickstart.mdx b/docs/developer/multi-tenant/quickstart.mdxindex c92b6c213b..37e5a381b7 100644--- a/docs/developer/multi-tenant/quickstart.mdx+++ b/docs/developer/multi-tenant/quickstart.mdx@@ -13,4 +13,8 @@ If you want to have a true multi-tenant application, you will need to purchase [To sum it up:* Multi-Store setup is recommended for running multiple brands or multiple language versions of the same store-* Multi-Tenant allows you to create a SaaS application with multiple tenants, each of them with their own Spree instance\ No newline at end of file+* Multi-Tenant allows you to create a SaaS application with multiple tenants, each of them with their own Spree instance++## Setup SaaS application++[Follow the installation instructions](/developer/multi-tenant/installation) to setup a multi-tenant Spree application.\ No newline at end of filediff --git a/docs/docs.json b/docs/docs.jsonindex 0f0e5c38a5..dda0487948 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -94,8 +94,8 @@"pages": ["developer/multi-tenant/quickstart","developer/multi-tenant/installation",- "developer/multi-tenant/core-concepts"-+ "developer/multi-tenant/core-concepts",+ "developer/multi-tenant/configuration"]}]