Bug #11772
openStandardize Base URL Fallback Consistency Across Quotation Email Channels
0%
Description
Problem Description
In
sendAcceptanceLink
, the base URL is safely resolved as:
javascript
const baseUrl = req.headers.origin || process.env.clientBaseUrl || "http://localhost:5173";
However, in
resendQuotationEmail:L4125
, it is written as:
javascript
const baseUrl = req.headers.origin || "http://localhost:5173";
If a resend is initiated by a webhook, automated script, server-to-server call, or an environment missing the Origin header, the acceptance link will point to http://localhost:5173 instead of the production client URL.
2. Acceptance Criteria
AC 3.1 (Consistent URL Resolution): Given a call to resendQuotationEmail where req.headers.origin is undefined or null, When the acceptance link is constructed, Then it MUST resolve to process.env.clientBaseUrl (or process.env.CLIENT_URL) before falling back to http://localhost:5173.
AC 3.2 (Cross-Module Parity): All email and SMS dispatch functions in QuotationController.js and product-quote.controller.js must use a single centralized helper function (e.g. getClientBaseUrl(req)) to resolve the customer-facing URL.
Subtasks
Related issues
No data to display