tripstorekrabi-shared 1.25.2 → 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 +15 -12
- package/package.json +1 -1
package/booking.js
CHANGED
|
@@ -177,33 +177,36 @@ 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, '');
|
|
185
|
-
signature += `<br
|
|
187
|
+
const cleanPhone = String(contact.phoneNumber).replace(/[^\d+]/g, '');
|
|
188
|
+
signature += `<br><a href="tel:${cleanPhone}">Call our office</a>`;
|
|
186
189
|
}
|
|
187
190
|
|
|
188
191
|
if (contact && contact.email) {
|
|
189
|
-
signature += `<br
|
|
192
|
+
signature += `<br><a href="mailto:${contact.email}">Send email</a>`;
|
|
190
193
|
}
|
|
191
194
|
|
|
192
195
|
if (contact && contact.respondNumber) {
|
|
193
|
-
const cleanRespond = contact.respondNumber.replace(/\D/g, '');
|
|
194
|
-
signature += `<br
|
|
196
|
+
const cleanRespond = String(contact.respondNumber).replace(/\D/g, '');
|
|
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, '');
|
|
199
|
-
signature += `<br
|
|
201
|
+
const cleanWhatsapp = String(contact.whatsappNumber).replace(/\D/g, '');
|
|
202
|
+
signature += `<br><a href="https://wa.me/${cleanWhatsapp}">Call on WhatsApp</a>`;
|
|
200
203
|
}
|
|
201
204
|
|
|
202
|
-
signature += `<br
|
|
205
|
+
signature += `<br><a href="https://t.me/tripstorekrabi_bot">Chat in Telegram</a>`;
|
|
203
206
|
|
|
204
|
-
signature += `<br
|
|
207
|
+
signature += `<br><a href="line://ti/p/@cjs7975w">Chat on LINE</a>`;
|
|
205
208
|
|
|
206
|
-
signature += `<br
|
|
209
|
+
signature += `<br><a href="https://m.me/tripstorekrabi">Message on Facebook</a>`;
|
|
207
210
|
|
|
208
211
|
return signature;
|
|
209
212
|
}
|