@capillarytech/creatives-library 7.12.60 → 7.12.62
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/package.json
CHANGED
|
@@ -388,6 +388,11 @@ export class Creatives extends React.Component {
|
|
|
388
388
|
}
|
|
389
389
|
return btn;
|
|
390
390
|
});
|
|
391
|
+
for (const key in varMapped) {
|
|
392
|
+
if (key.includes('_unsubscribe')) {
|
|
393
|
+
delete varMapped[key];
|
|
394
|
+
}
|
|
395
|
+
}
|
|
391
396
|
const unsubscribeRegex = /Click {{unsubscribe}} to unsubscribe/g;
|
|
392
397
|
creativesTemplateData = {
|
|
393
398
|
type: constants.WHATSAPP,
|
|
@@ -597,6 +602,7 @@ export class Creatives extends React.Component {
|
|
|
597
602
|
buttons = [],
|
|
598
603
|
imageUrl = '',
|
|
599
604
|
} = cloneDeep(versions.base.content.whatsapp);
|
|
605
|
+
|
|
600
606
|
const modifiedButtons = cloneDeep(buttons).map((btn) => {
|
|
601
607
|
if (btn.type === 'PHONE_NUMBER') {
|
|
602
608
|
btn.phoneNumber = btn.phone_number;
|
|
@@ -607,6 +613,19 @@ export class Creatives extends React.Component {
|
|
|
607
613
|
}
|
|
608
614
|
return btn;
|
|
609
615
|
});
|
|
616
|
+
|
|
617
|
+
//to send {{unsubscribe}} to backend inside varMapped
|
|
618
|
+
const unsubscribeRegex = /Click {{unsubscribe}} to unsubscribe/g;
|
|
619
|
+
if (
|
|
620
|
+
languages[0].content?.match(unsubscribeRegex)?.length > 0 &&
|
|
621
|
+
Object.keys(varMapped)?.every(
|
|
622
|
+
(key) => !key?.includes("_unsubscribe")
|
|
623
|
+
)
|
|
624
|
+
) {
|
|
625
|
+
varMapped[`{{${Object.keys(varMapped).length + 1}}}_unsubscribe`] =
|
|
626
|
+
"{{unsubscribe}}";
|
|
627
|
+
}
|
|
628
|
+
|
|
610
629
|
templateData = {
|
|
611
630
|
channel,
|
|
612
631
|
accountId,
|