feat(cms): white-label email templates and API doc config (#2)
All checks were successful
Build and publish / build (push) Successful in 7m11s
All checks were successful
Build and publish / build (push) Successful in 7m11s
## Summary - Replace all hardcoded muellerprints brand identity in email templates with template variables sourced from env vars - Inject shop context into both `sendInvoice` and `sendDeliveryNote` template calls in `order.ts` - Make API documentation title/description env-var driven ## New env vars (all optional with safe defaults) | Var | Default | Used in | |-----|---------|---------| | `SHOP_NAME` | `"Shop"` | Email subject, body, footer | | `SHOP_CONTACT_NAME` | `""` | Email footer | | `SHOP_ADDRESS` | `""` | Email footer | | `SHOP_PHONE` | `""` | Email footer | | `SHOP_EMAIL` | `ADMIN_EMAIL_ADDRESS` | Email footer | | `SHOP_LOGO_URL` | `""` | Email header logo | | `SHOP_SECONDARY_LOGO_URL` | `""` | Email footer logo | | `API_TITLE` | `"Paperwork API"` | Swagger/OpenAPI title | | `API_DESCRIPTION` | `"Paperwork API"` | Swagger/OpenAPI description | ## Test plan - [ ] Set `SHOP_NAME=TestShop` and trigger invoice send → confirm subject and body use `TestShop` - [ ] Leave `SHOP_NAME` unset → confirm default `"Shop"` appears - [ ] Set `SHOP_LOGO_URL` → confirm logo renders in email header; unset → confirm no broken `<img>` tag - [ ] Check Strapi admin `/documentation` with `API_TITLE=MyAPI` env var Closes #1 Reviewed-on: #2 Co-authored-by: Michael Czechowski <mail@dailysh.it> Co-committed-by: Michael Czechowski <mail@dailysh.it>
This commit is contained in:
@@ -10,6 +10,14 @@ export const paypalEnvironment = process.env.PAYPAL_ENVIRONMENT! === "production
|
||||
|
||||
export const adminEmail = process.env.ADMIN_EMAIL_ADDRESS!;
|
||||
|
||||
export const shopName = process.env.SHOP_NAME ?? "Shop";
|
||||
export const shopContactName = process.env.SHOP_CONTACT_NAME ?? "";
|
||||
export const shopAddress = process.env.SHOP_ADDRESS ?? "";
|
||||
export const shopPhone = process.env.SHOP_PHONE ?? "";
|
||||
export const shopEmail = process.env.SHOP_EMAIL ?? process.env.ADMIN_EMAIL_ADDRESS ?? "";
|
||||
export const shopLogoUrl = process.env.SHOP_LOGO_URL ?? "";
|
||||
export const shopSecondaryLogoUrl = process.env.SHOP_SECONDARY_LOGO_URL ?? "";
|
||||
|
||||
// TODO: Should be retrieved from DepotApi
|
||||
export const vatIncludedDecimal = 1.19;
|
||||
// TODO: Should be retrieved from DepotApi
|
||||
|
||||
@@ -10,15 +10,11 @@ export default ({ env }) => ({
|
||||
openapi: "3.0.1",
|
||||
info: {
|
||||
version: "1.0.0",
|
||||
title: "MUELLERPTINTS. Paperwork",
|
||||
description: "API Documentation for MUELLERPRINTS. Paperwork",
|
||||
title: env("API_TITLE", "Paperwork API"),
|
||||
description: env("API_DESCRIPTION", "Paperwork API"),
|
||||
termsOfService: false,
|
||||
contact: {
|
||||
name: "Michael W. Czechowski",
|
||||
email: "mail@dailysh.it",
|
||||
url: "https://dailysh.it"
|
||||
},
|
||||
license: "Copyright (C) 2024 Michael W. Czechowski",
|
||||
contact: false,
|
||||
license: false,
|
||||
externalDocs: false
|
||||
},
|
||||
"x-strapi-config": {
|
||||
|
||||
Reference in New Issue
Block a user