@capillarytech/creatives-library 9.0.30 → 9.0.31
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
|
@@ -1056,7 +1056,7 @@ const CommonTestAndPreview = (props) => {
|
|
|
1056
1056
|
const buildRcsTestMessagePayload = (
|
|
1057
1057
|
creativeFormData,
|
|
1058
1058
|
_unusedEditorContentString,
|
|
1059
|
-
|
|
1059
|
+
customValuesObj,
|
|
1060
1060
|
deliverySettingsOverride,
|
|
1061
1061
|
basePayload,
|
|
1062
1062
|
_rcsTestMetaExtras = {},
|
|
@@ -1071,7 +1071,9 @@ const CommonTestAndPreview = (props) => {
|
|
|
1071
1071
|
} else if (rcsContentFromForm?.cardContent) {
|
|
1072
1072
|
rcsCardPayloadList = [rcsContentFromForm.cardContent];
|
|
1073
1073
|
}
|
|
1074
|
-
//
|
|
1074
|
+
// Title/description/suggestion text carry {{tag}} placeholders; resolve them against the
|
|
1075
|
+
// user's test values here, same as every other channel (see resolveTagsInText usage below
|
|
1076
|
+
// for SMS/EMAIL/WHATSAPP) — otherwise the test send goes out with literal tags unresolved.
|
|
1075
1077
|
const cardContentForTestMetaApi = rcsCardPayloadList.map((singleRcsCardPayload) => {
|
|
1076
1078
|
const normalizedCardMediaForTestApi = singleRcsCardPayload?.media
|
|
1077
1079
|
? normalizeRcsTestCardMedia(singleRcsCardPayload.media)
|
|
@@ -1079,11 +1081,13 @@ const CommonTestAndPreview = (props) => {
|
|
|
1079
1081
|
const suggestionsFromCard = Array.isArray(singleRcsCardPayload?.suggestions)
|
|
1080
1082
|
? singleRcsCardPayload.suggestions
|
|
1081
1083
|
: [];
|
|
1082
|
-
const suggestionsFormattedForTestMeta = suggestionsFromCard.map((suggestionItem, index) =>
|
|
1083
|
-
|
|
1084
|
+
const suggestionsFormattedForTestMeta = suggestionsFromCard.map((suggestionItem, index) => mapRcsSuggestionForTestMeta(
|
|
1085
|
+
{ ...suggestionItem, text: resolveTagsInText(suggestionItem?.text, customValuesObj) },
|
|
1086
|
+
index,
|
|
1087
|
+
));
|
|
1084
1088
|
return {
|
|
1085
|
-
title: singleRcsCardPayload?.title ?? '',
|
|
1086
|
-
description: singleRcsCardPayload?.description ?? '',
|
|
1089
|
+
title: resolveTagsInText(singleRcsCardPayload?.title ?? '', customValuesObj),
|
|
1090
|
+
description: resolveTagsInText(singleRcsCardPayload?.description ?? '', customValuesObj),
|
|
1087
1091
|
mediaType: singleRcsCardPayload?.mediaType ?? MEDIA_TYPE_TEXT,
|
|
1088
1092
|
...(normalizedCardMediaForTestApi && { media: normalizedCardMediaForTestApi }),
|
|
1089
1093
|
...(suggestionsFormattedForTestMeta.length > 0 && {
|