@capillarytech/creatives-library 3.1.26 → 3.1.27
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.
|
@@ -149,7 +149,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
149
149
|
{smsDetails.unicode &&
|
|
150
150
|
<div style={{fontSize: '16px'}}>{`${this.props.intl.formatMessage(messages.smsFormatType)}`}</div>
|
|
151
151
|
}
|
|
152
|
-
<div style={{marginTop: '8px', fontSize: '16px'}} >{`${smsDetails.parts} ${this.props.intl.formatMessage(messages.sms)} (${smsDetails.
|
|
152
|
+
<div style={{marginTop: '8px', fontSize: '16px'}} >{`${smsDetails.parts} ${this.props.intl.formatMessage(messages.sms)} (${smsDetails.actual_chars_used} ${this.props.intl.formatMessage(messages.characters)})`}</div>
|
|
153
153
|
{smsDetails.optoutUrlPresent && <div style={{fontWeight: '100', fontSize: '12px'}}>
|
|
154
154
|
{`${this.props.intl.formatMessage(messages.includesOptoutTag)} (${smsDetails.optouturlLength} ${this.props.intl.formatMessage(messages.characters)})`}
|
|
155
155
|
</div>}
|
|
@@ -28,7 +28,7 @@ export default defineMessages({
|
|
|
28
28
|
},
|
|
29
29
|
includesOptoutTag: {
|
|
30
30
|
id: 'app.components.TemplatePreview.includesOptoutTag',
|
|
31
|
-
defaultMessage: 'Includes
|
|
31
|
+
defaultMessage: 'Includes optout tag',
|
|
32
32
|
},
|
|
33
33
|
previewGenerated: {
|
|
34
34
|
id: 'creatives.components.TemplatePreview.previewGenerated',
|
package/package.json
CHANGED
package/utils/smsCharCountV2.js
CHANGED
|
@@ -88,7 +88,7 @@ export function updateCharCount(content, isUnicodeEnabled) {
|
|
|
88
88
|
break;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
const actual_chars_used = showOptoutCount ? (chars_used + (((optoutUrl && optoutUrl.length) || 0) * noOfOptout) - (optoutTagLength * noOfOptout)) : chars_used;
|
|
92
92
|
if (coding == '7bit') {
|
|
93
93
|
if (chars_used > 160) {
|
|
94
94
|
var parts = Math.ceil(chars_used / 153);
|
|
@@ -147,5 +147,6 @@ export function updateCharCount(content, isUnicodeEnabled) {
|
|
|
147
147
|
optouturlLength: (optoutUrl && optoutUrl.length) || 0,
|
|
148
148
|
optoutUrlPresent: noOfOptout > 0,
|
|
149
149
|
responseState,
|
|
150
|
+
actual_chars_used,
|
|
150
151
|
};
|
|
151
152
|
}
|
|
@@ -54,7 +54,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
54
54
|
<CapRow>
|
|
55
55
|
{this.props.showCount && <CapColumn span={16}>
|
|
56
56
|
{channel && channel.toLowerCase() === 'sms' && <CapHeading type="h3">
|
|
57
|
-
<FormattedMessage {...messages.charactersTotal} values={{smsCount: smsDetails.parts, charCount: smsDetails.
|
|
57
|
+
<FormattedMessage {...messages.charactersTotal} values={{smsCount: smsDetails.parts, charCount: smsDetails.actual_chars_used}}/>
|
|
58
58
|
{smsDetails.unicode &&
|
|
59
59
|
<FormattedMessage {...messages.smsFormatType}/>
|
|
60
60
|
}
|
|
@@ -83,7 +83,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
83
83
|
{!this.props.showCount && <div>
|
|
84
84
|
<CapColumn className="character-count-col" span={22}>
|
|
85
85
|
{channel && channel.toLowerCase() === 'sms' && <CapHeading type="h3">
|
|
86
|
-
<FormattedMessage {...messages.charactersTotal} values={{smsCount: smsDetails.parts, charCount: smsDetails.
|
|
86
|
+
<FormattedMessage {...messages.charactersTotal} values={{smsCount: smsDetails.parts, charCount: smsDetails.actual_chars_used}}/>
|
|
87
87
|
{smsDetails.unicode &&
|
|
88
88
|
<FormattedMessage {...messages.smsFormatType}/>
|
|
89
89
|
}
|
|
@@ -24,7 +24,7 @@ export default defineMessages({
|
|
|
24
24
|
},
|
|
25
25
|
optoutCharactersTotal: {
|
|
26
26
|
id: 'app.components.TemplatePreview.optoutCharactersTotal',
|
|
27
|
-
defaultMessage: "Includes
|
|
27
|
+
defaultMessage: "Includes optout tag ({optoutUrlLength} characters)",
|
|
28
28
|
},
|
|
29
29
|
smsFormatType: {
|
|
30
30
|
id: 'creatives.componentsV2.TemplatePreview.smsFormatType',
|