tripstorekrabi-shared 1.25.3 → 1.25.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/booking.js +8 -5
- package/package.json +1 -1
package/booking.js
CHANGED
|
@@ -177,11 +177,14 @@ export function addBookingFromInvoice(
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
export function getOperatorSignature(operatorName, contact) {
|
|
181
|
-
|
|
180
|
+
export function getOperatorSignature(agent, operatorName, contact) {
|
|
181
|
+
const namePrefix = agent ? `${agent} - ` : '';
|
|
182
|
+
const safeOperatorName = operatorName || '';
|
|
183
|
+
|
|
184
|
+
let signature = `<br><br>Warm regards,<br><br><strong>${namePrefix}${safeOperatorName}</strong><br>`;
|
|
182
185
|
|
|
183
186
|
if (contact && contact.phoneNumber) {
|
|
184
|
-
const cleanPhone = contact.phoneNumber.replace(/[^\d+]/g, '');
|
|
187
|
+
const cleanPhone = String(contact.phoneNumber).replace(/[^\d+]/g, '');
|
|
185
188
|
signature += `<br><a href="tel:${cleanPhone}">Call our office</a>`;
|
|
186
189
|
}
|
|
187
190
|
|
|
@@ -190,12 +193,12 @@ export function getOperatorSignature(operatorName, contact) {
|
|
|
190
193
|
}
|
|
191
194
|
|
|
192
195
|
if (contact && contact.respondNumber) {
|
|
193
|
-
const cleanRespond = contact.respondNumber.replace(/\D/g, '');
|
|
196
|
+
const cleanRespond = String(contact.respondNumber).replace(/\D/g, '');
|
|
194
197
|
signature += `<br><a href="https://wa.me/${cleanRespond}">Chat on WhatsApp</a>`;
|
|
195
198
|
}
|
|
196
199
|
|
|
197
200
|
if (contact && contact.whatsappNumber) {
|
|
198
|
-
const cleanWhatsapp = contact.whatsappNumber.replace(/\D/g, '');
|
|
201
|
+
const cleanWhatsapp = String(contact.whatsappNumber).replace(/\D/g, '');
|
|
199
202
|
signature += `<br><a href="https://wa.me/${cleanWhatsapp}">Call on WhatsApp</a>`;
|
|
200
203
|
}
|
|
201
204
|
|