Project

General

Profile

Edit Copy Actions

Bug #11772

open

Standardize Base URL Fallback Consistency Across Quotation Email Channels

Added by Yalavarthi Thriveni 5 days ago.

Status:
New
Priority:
Normal
Start date:
10/28/2026
Due date:
% Done:

0%

Estimated time:
1:00 h
Tested Date:
10/29/2026
Raised by Tester:
Page/ Module (POS):
Quotes

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.


Add

Subtasks


Add

Related issues

No data to display

Edit Copy Actions

Also available in: Atom PDF