ampscript-data 3.7.0 → 4.0.0
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 +2 -2
- package/src/constants.js +47 -0
- package/src/derived.js +100 -0
- package/src/functions/content.js +1028 -0
- package/src/functions/data-extension.js +1117 -0
- package/src/functions/date-time.js +411 -0
- package/src/functions/einstein-email-recs.js +32 -0
- package/src/functions/encryption-encoding.js +545 -0
- package/src/functions/http.js +338 -0
- package/src/functions/index.js +203 -0
- package/src/functions/marketing-cloud-api.js +378 -0
- package/src/functions/math.js +167 -0
- package/src/functions/microsoft-dynamics.js +400 -0
- package/src/functions/mobileconnect.js +339 -0
- package/src/functions/sales-service-cloud.js +230 -0
- package/src/functions/social.js +151 -0
- package/src/functions/string.js +432 -0
- package/src/functions/utility.js +1118 -0
- package/src/globals.js +9 -0
- package/src/index.js +34 -7228
- package/src/keywords.js +121 -0
- package/src/operators.js +66 -0
- package/src/personalization.js +254 -0
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
// AUTO-SPLIT from the original single-file src/index.js. Data moved verbatim.
|
|
2
|
+
// AMPscript FUNCTIONS — category: Encryption and Encoding (12 entries).
|
|
3
|
+
|
|
4
|
+
export const ENCRYPTION_ENCODING_FUNCTIONS = [
|
|
5
|
+
{
|
|
6
|
+
name: 'Base64Decode',
|
|
7
|
+
supportedInCloudPage: true,
|
|
8
|
+
supportedInEmail: true,
|
|
9
|
+
mcnSince: null,
|
|
10
|
+
handlebarsEquivalent: null,
|
|
11
|
+
mcnNotes: null,
|
|
12
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-base64-decode.html',
|
|
13
|
+
guideUrl: 'https://ampscript.guide/base64decode/',
|
|
14
|
+
minArgs: 1,
|
|
15
|
+
maxArgs: 3,
|
|
16
|
+
category: 'Encryption and Encoding',
|
|
17
|
+
description:
|
|
18
|
+
'Decodes a Base64-encoded string. The decoded bytes are read as UTF-8 unless encoding names another character encoding, and any value that is not well-formed Base64 aborts the page instead of returning an empty or partial result.',
|
|
19
|
+
params: [
|
|
20
|
+
{
|
|
21
|
+
name: 'encodedString',
|
|
22
|
+
description:
|
|
23
|
+
'Base64 string to decode; it must be well-formed, because malformed input aborts the page',
|
|
24
|
+
type: 'string',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'encoding',
|
|
28
|
+
description:
|
|
29
|
+
'Name of the character encoding used to turn the decoded bytes back into text; defaults to UTF-8, and an unrecognised or empty name aborts the page',
|
|
30
|
+
type: 'string',
|
|
31
|
+
enum: ['UTF-8', 'UTF-16', 'UTF-16BE', 'UTF-32', 'ASCII', 'ISO-8859-1'],
|
|
32
|
+
optional: true,
|
|
33
|
+
default: 'UTF-8',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'abortOnFailure',
|
|
37
|
+
mcnSince: null,
|
|
38
|
+
mcnNotes: null,
|
|
39
|
+
description:
|
|
40
|
+
'Flag reserved for send-time failure handling; 0, 1, true and false are all accepted and none of them changes the value a successful decode returns',
|
|
41
|
+
type: 'number|boolean',
|
|
42
|
+
optional: true,
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
returnType: 'string',
|
|
46
|
+
returnDescription: 'The decoded string.',
|
|
47
|
+
syntax: 'Base64Decode(encodedString[, encoding, abortOnFailure])',
|
|
48
|
+
example: "%%=Base64Decode('SGVsbG8=')=%%",
|
|
49
|
+
isConfirmed: true,
|
|
50
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/base64decode/',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'Base64Encode',
|
|
54
|
+
supportedInCloudPage: true,
|
|
55
|
+
supportedInEmail: true,
|
|
56
|
+
mcnSince: null,
|
|
57
|
+
handlebarsEquivalent: null,
|
|
58
|
+
mcnNotes: null,
|
|
59
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-base64-encode.html',
|
|
60
|
+
guideUrl: 'https://ampscript.guide/base64encode/',
|
|
61
|
+
minArgs: 1,
|
|
62
|
+
maxArgs: 2,
|
|
63
|
+
category: 'Encryption and Encoding',
|
|
64
|
+
description:
|
|
65
|
+
'Encodes a value as a Base64 string. The bytes encoded are the UTF-8 representation of the input unless encoding names another character encoding.',
|
|
66
|
+
params: [
|
|
67
|
+
{
|
|
68
|
+
name: 'value',
|
|
69
|
+
description: 'Value to encode; the empty string encodes to the empty string',
|
|
70
|
+
type: 'string',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'encoding',
|
|
74
|
+
description:
|
|
75
|
+
'Name of the character encoding applied before encoding; any encoding name the platform recognises works, and an unrecognised or empty name aborts the page',
|
|
76
|
+
type: 'string',
|
|
77
|
+
enum: ['UTF-8', 'UTF-16', 'UTF-16BE', 'UTF-32', 'ASCII', 'ISO-8859-1'],
|
|
78
|
+
optional: true,
|
|
79
|
+
default: 'UTF-8',
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
returnType: 'string',
|
|
83
|
+
returnDescription:
|
|
84
|
+
'The Base64-encoded representation of the input, padded with = to a multiple of four characters.',
|
|
85
|
+
syntax: 'Base64Encode(value[, encoding])',
|
|
86
|
+
example: "%%=Base64Encode('Hello')=%%",
|
|
87
|
+
isConfirmed: true,
|
|
88
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/base64encode/',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'DecryptSymmetric',
|
|
92
|
+
supportedInCloudPage: true,
|
|
93
|
+
supportedInEmail: true,
|
|
94
|
+
mcnSince: null,
|
|
95
|
+
handlebarsEquivalent: null,
|
|
96
|
+
mcnNotes: null,
|
|
97
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-encryption/mc-ampscript-reference-encryption-decrypt-symmetric.html',
|
|
98
|
+
guideUrl: 'https://ampscript.guide/decryptsymmetric/',
|
|
99
|
+
minArgs: 8,
|
|
100
|
+
maxArgs: 8,
|
|
101
|
+
category: 'Encryption and Encoding',
|
|
102
|
+
isConfirmed: true,
|
|
103
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/decryptsymmetric/',
|
|
104
|
+
description:
|
|
105
|
+
'Decrypts a Base64 ciphertext produced by EncryptSymmetric, using the same algorithm, passphrase, salt and initialization vector.',
|
|
106
|
+
params: [
|
|
107
|
+
{
|
|
108
|
+
name: 'encryptedValue',
|
|
109
|
+
description: 'Base64 ciphertext to decrypt',
|
|
110
|
+
type: 'string',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'algorithm',
|
|
114
|
+
description:
|
|
115
|
+
'Cipher name, optionally followed by semicolon-separated mode and padding settings; must match the settings used to encrypt, and an unrecognised name aborts the page',
|
|
116
|
+
type: 'string',
|
|
117
|
+
enum: ['aes', 'des', 'tripledes'],
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'passwordExternalKey',
|
|
121
|
+
mcnSince: null,
|
|
122
|
+
mcnNotes: null,
|
|
123
|
+
description: 'External key for the password',
|
|
124
|
+
type: 'string',
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: 'password',
|
|
128
|
+
mcnSince: null,
|
|
129
|
+
mcnNotes: null,
|
|
130
|
+
description: 'Password value or empty to use external key',
|
|
131
|
+
type: 'string',
|
|
132
|
+
},
|
|
133
|
+
{ name: 'saltExternalKey', description: 'External key for the salt', type: 'string' },
|
|
134
|
+
{
|
|
135
|
+
name: 'salt',
|
|
136
|
+
mcnSince: null,
|
|
137
|
+
mcnNotes: null,
|
|
138
|
+
description: 'Salt value or empty to use external key',
|
|
139
|
+
type: 'string',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: 'ivExternalKey',
|
|
143
|
+
mcnSince: null,
|
|
144
|
+
mcnNotes: null,
|
|
145
|
+
description: 'External key for the initialization vector',
|
|
146
|
+
type: 'string',
|
|
147
|
+
},
|
|
148
|
+
{ name: 'iv', description: 'IV value or empty to use external key', type: 'string' },
|
|
149
|
+
],
|
|
150
|
+
returnType: 'string',
|
|
151
|
+
returnDescription: 'The decrypted plain-text value.',
|
|
152
|
+
syntax: 'DecryptSymmetric(encryptedValue, algorithm, passwordExternalKey, password, saltExternalKey, salt, ivExternalKey, iv)',
|
|
153
|
+
example:
|
|
154
|
+
"%%=DecryptSymmetric(@encrypted, 'aes', 'pwKey', '', 'saltKey', '', 'ivKey', '')=%%",
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: 'EncryptSymmetric',
|
|
158
|
+
supportedInCloudPage: true,
|
|
159
|
+
supportedInEmail: true,
|
|
160
|
+
mcnSince: null,
|
|
161
|
+
handlebarsEquivalent: null,
|
|
162
|
+
mcnNotes: null,
|
|
163
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-encryption/mc-ampscript-reference-encryption-encrypt-symmetric.html',
|
|
164
|
+
guideUrl: 'https://ampscript.guide/encryptsymmetric/',
|
|
165
|
+
minArgs: 8,
|
|
166
|
+
maxArgs: 8,
|
|
167
|
+
category: 'Encryption and Encoding',
|
|
168
|
+
isConfirmed: true,
|
|
169
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/encryptsymmetric/',
|
|
170
|
+
description:
|
|
171
|
+
'Encrypts a value using symmetric key encryption and returns the ciphertext as Base64. The result is deterministic: the same inputs produce the same ciphertext on every call.',
|
|
172
|
+
params: [
|
|
173
|
+
{ name: 'value', description: 'Value to encrypt', type: 'string' },
|
|
174
|
+
{
|
|
175
|
+
name: 'algorithm',
|
|
176
|
+
description:
|
|
177
|
+
'Cipher name, optionally followed by semicolon-separated mode and padding settings such as des;mode=ecb;padding=zeros; an unrecognised name aborts the page',
|
|
178
|
+
type: 'string',
|
|
179
|
+
enum: ['aes', 'des', 'tripledes'],
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
name: 'passwordExternalKey',
|
|
183
|
+
mcnSince: null,
|
|
184
|
+
mcnNotes: null,
|
|
185
|
+
description: 'External key for the password',
|
|
186
|
+
type: 'string',
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: 'password',
|
|
190
|
+
mcnSince: null,
|
|
191
|
+
mcnNotes: null,
|
|
192
|
+
description: 'Password value or empty to use external key',
|
|
193
|
+
type: 'string',
|
|
194
|
+
},
|
|
195
|
+
{ name: 'saltExternalKey', description: 'External key for the salt', type: 'string' },
|
|
196
|
+
{
|
|
197
|
+
name: 'salt',
|
|
198
|
+
mcnSince: null,
|
|
199
|
+
mcnNotes: null,
|
|
200
|
+
description: 'Salt value or empty to use external key',
|
|
201
|
+
type: 'string',
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: 'ivExternalKey',
|
|
205
|
+
mcnSince: null,
|
|
206
|
+
mcnNotes: null,
|
|
207
|
+
description: 'External key for the initialization vector',
|
|
208
|
+
type: 'string',
|
|
209
|
+
},
|
|
210
|
+
{ name: 'iv', description: 'IV value or empty to use external key', type: 'string' },
|
|
211
|
+
],
|
|
212
|
+
returnType: 'string',
|
|
213
|
+
returnDescription: 'The ciphertext, Base64-encoded.',
|
|
214
|
+
syntax: 'EncryptSymmetric(value, algorithm, passwordExternalKey, password, saltExternalKey, salt, ivExternalKey, iv)',
|
|
215
|
+
example: "%%=EncryptSymmetric('secret', 'aes', 'pwKey', '', 'saltKey', '', 'ivKey', '')=%%",
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: 'GetJWT',
|
|
219
|
+
supportedInCloudPage: true,
|
|
220
|
+
supportedInEmail: true,
|
|
221
|
+
mcnSince: null,
|
|
222
|
+
handlebarsEquivalent: null,
|
|
223
|
+
mcnNotes: null,
|
|
224
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-encryption/mc-ampscript-reference-encryption-get-jwt.html',
|
|
225
|
+
guideUrl: 'https://ampscript.guide/getjwt/',
|
|
226
|
+
minArgs: 3,
|
|
227
|
+
maxArgs: 3,
|
|
228
|
+
category: 'Encryption and Encoding',
|
|
229
|
+
description:
|
|
230
|
+
'Generates a JSON Web Token signed with the supplied inline secret. The payload is passed through verbatim and is only Base64url-encoded, never encrypted.',
|
|
231
|
+
params: [
|
|
232
|
+
{
|
|
233
|
+
name: 'secret',
|
|
234
|
+
description:
|
|
235
|
+
'Secret used to sign the token; the empty string aborts the page rather than signing with an empty key',
|
|
236
|
+
type: 'string',
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: 'algorithm',
|
|
240
|
+
description:
|
|
241
|
+
'HMAC algorithm name, matched case-insensitively; an unknown name aborts the page',
|
|
242
|
+
type: 'string',
|
|
243
|
+
enum: ['HS256', 'HS384', 'HS512'],
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
name: 'jsonPayload',
|
|
247
|
+
description:
|
|
248
|
+
'Payload to encode. It is copied into the token untouched and is not validated as JSON, so a non-JSON string is signed just as readily.',
|
|
249
|
+
type: 'string',
|
|
250
|
+
},
|
|
251
|
+
],
|
|
252
|
+
returnType: 'string',
|
|
253
|
+
returnDescription:
|
|
254
|
+
'The token as three Base64url segments joined by dots, with no padding. The same arguments always produce the same token.',
|
|
255
|
+
isConfirmed: true,
|
|
256
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/getjwt/',
|
|
257
|
+
syntax: 'GetJWT(secret, algorithm, jsonPayload)',
|
|
258
|
+
example: "%%=GetJWT(@secret, 'HS256', @payload)=%%",
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
name: 'GetJWTByKeyName',
|
|
262
|
+
supportedInCloudPage: true,
|
|
263
|
+
supportedInEmail: true,
|
|
264
|
+
mcnSince: null,
|
|
265
|
+
handlebarsEquivalent: null,
|
|
266
|
+
mcnNotes: null,
|
|
267
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-encryption/mc-ampscript-reference-encryption-get-jwt-by-key-name.html',
|
|
268
|
+
guideUrl: 'https://ampscript.guide/getjwtbykeyname/',
|
|
269
|
+
minArgs: 3,
|
|
270
|
+
maxArgs: 3,
|
|
271
|
+
category: 'Encryption and Encoding',
|
|
272
|
+
description: 'Generates a JSON Web Token using a named encryption key from Key Management.',
|
|
273
|
+
params: [
|
|
274
|
+
{ name: 'keyName', description: 'Key Management key external key', type: 'string' },
|
|
275
|
+
{
|
|
276
|
+
name: 'algorithm',
|
|
277
|
+
description: 'Signing algorithm',
|
|
278
|
+
type: 'string',
|
|
279
|
+
enum: ['HS256', 'HS384', 'HS512', 'RS256', 'RS384', 'RS512'],
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
name: 'jsonPayload',
|
|
283
|
+
description:
|
|
284
|
+
"The payload of the JWT. Typically, the payload is a JSON object with name-value pairs. The JWT payload isn't encrypted.",
|
|
285
|
+
type: 'string',
|
|
286
|
+
},
|
|
287
|
+
],
|
|
288
|
+
returnType: 'string',
|
|
289
|
+
returnDescription: 'A signed JSON Web Token string created with the named key.',
|
|
290
|
+
isConfirmed: true,
|
|
291
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/getjwtbykeyname/',
|
|
292
|
+
syntax: 'GetJWTByKeyName(keyName, algorithm, jsonPayload)',
|
|
293
|
+
example: "%%=GetJWTByKeyName('MyKeyName', 'HS256', @payload)=%%",
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
name: 'MD5',
|
|
297
|
+
supportedInCloudPage: true,
|
|
298
|
+
supportedInEmail: true,
|
|
299
|
+
mcnSince: null,
|
|
300
|
+
handlebarsEquivalent: null,
|
|
301
|
+
mcnNotes: null,
|
|
302
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-encryption/mc-ampscript-reference-encryption-md5.html',
|
|
303
|
+
guideUrl: 'https://ampscript.guide/md5/',
|
|
304
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/md5/',
|
|
305
|
+
minArgs: 1,
|
|
306
|
+
maxArgs: 2,
|
|
307
|
+
category: 'Encryption and Encoding',
|
|
308
|
+
description:
|
|
309
|
+
'Returns the MD5 hash of the input value. The bytes hashed are the UTF-8 encoding of the input unless charSet names another encoding, and a number or date argument is hashed as the text it renders as.',
|
|
310
|
+
params: [
|
|
311
|
+
{
|
|
312
|
+
name: 'stringToConvert',
|
|
313
|
+
description:
|
|
314
|
+
'The value to hash; a number or date is hashed as its rendered text, and the empty string yields the well-known empty-input digest',
|
|
315
|
+
type: 'string|number|date',
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
name: 'charSet',
|
|
319
|
+
mcnSince: null,
|
|
320
|
+
mcnNotes: null,
|
|
321
|
+
description:
|
|
322
|
+
'Name of the character encoding applied before hashing; any encoding name the platform recognises works, and an unrecognised or empty name aborts the page',
|
|
323
|
+
type: 'string',
|
|
324
|
+
enum: ['UTF-8', 'UTF-16', 'UTF-16BE', 'UTF-32', 'ASCII', 'ISO-8859-1'],
|
|
325
|
+
optional: true,
|
|
326
|
+
default: 'UTF-8',
|
|
327
|
+
},
|
|
328
|
+
],
|
|
329
|
+
returnType: 'string',
|
|
330
|
+
returnDescription: 'The MD5 hash of the input as 32 lowercase hexadecimal characters.',
|
|
331
|
+
syntax: 'MD5(stringToConvert[, charSet])',
|
|
332
|
+
example: '%%=MD5("This is a string of text.")=%%',
|
|
333
|
+
isConfirmed: true,
|
|
334
|
+
differsFromOfficialDocs: false,
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
name: 'SHA1',
|
|
338
|
+
supportedInCloudPage: true,
|
|
339
|
+
supportedInEmail: true,
|
|
340
|
+
mcnSince: null,
|
|
341
|
+
handlebarsEquivalent: null,
|
|
342
|
+
mcnNotes: null,
|
|
343
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-encryption/mc-ampscript-reference-encryption-sha1.html',
|
|
344
|
+
guideUrl: 'https://ampscript.guide/sha1/',
|
|
345
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/sha1/',
|
|
346
|
+
minArgs: 1,
|
|
347
|
+
maxArgs: 2,
|
|
348
|
+
category: 'Encryption and Encoding',
|
|
349
|
+
description:
|
|
350
|
+
'Returns the SHA-1 hash of the input value. The bytes hashed are the UTF-8 encoding of the input unless charSet names another encoding, and a number or date argument is hashed as the text it renders as.',
|
|
351
|
+
params: [
|
|
352
|
+
{
|
|
353
|
+
name: 'stringToConvert',
|
|
354
|
+
description:
|
|
355
|
+
'The value to hash; a number or date is hashed as its rendered text, and the empty string yields the well-known empty-input digest',
|
|
356
|
+
type: 'string|number|date',
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
name: 'charSet',
|
|
360
|
+
mcnSince: null,
|
|
361
|
+
mcnNotes: null,
|
|
362
|
+
description:
|
|
363
|
+
'Name of the character encoding applied before hashing; any encoding name the platform recognises works, and an unrecognised or empty name aborts the page',
|
|
364
|
+
type: 'string',
|
|
365
|
+
enum: ['UTF-8', 'UTF-16', 'UTF-16BE', 'UTF-32', 'ASCII', 'ISO-8859-1'],
|
|
366
|
+
optional: true,
|
|
367
|
+
default: 'UTF-8',
|
|
368
|
+
},
|
|
369
|
+
],
|
|
370
|
+
returnType: 'string',
|
|
371
|
+
returnDescription: 'The SHA-1 hash of the input as 40 lowercase hexadecimal characters.',
|
|
372
|
+
syntax: 'SHA1(stringToConvert[, charSet])',
|
|
373
|
+
example: "%%=SHA1('This is a string of text.')=%%",
|
|
374
|
+
isConfirmed: true,
|
|
375
|
+
differsFromOfficialDocs: false,
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
name: 'SHA256',
|
|
379
|
+
supportedInCloudPage: true,
|
|
380
|
+
supportedInEmail: true,
|
|
381
|
+
mcnSince: null,
|
|
382
|
+
handlebarsEquivalent: null,
|
|
383
|
+
mcnNotes: null,
|
|
384
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-encryption/mc-ampscript-reference-encryption-sha256.html',
|
|
385
|
+
guideUrl: 'https://ampscript.guide/sha256/',
|
|
386
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/sha256/',
|
|
387
|
+
minArgs: 1,
|
|
388
|
+
maxArgs: 2,
|
|
389
|
+
category: 'Encryption and Encoding',
|
|
390
|
+
description:
|
|
391
|
+
'Returns the SHA-256 hash of the input value. The bytes hashed are the UTF-8 encoding of the input unless charSet names another encoding, and a number or date argument is hashed as the text it renders as.',
|
|
392
|
+
params: [
|
|
393
|
+
{
|
|
394
|
+
name: 'stringToConvert',
|
|
395
|
+
description:
|
|
396
|
+
'The value to hash; a number or date is hashed as its rendered text, and the empty string yields the well-known empty-input digest',
|
|
397
|
+
type: 'string|number|date',
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
name: 'charSet',
|
|
401
|
+
mcnSince: null,
|
|
402
|
+
mcnNotes: null,
|
|
403
|
+
description:
|
|
404
|
+
'Name of the character encoding applied before hashing; any encoding name the platform recognises works, and an unrecognised or empty name aborts the page',
|
|
405
|
+
type: 'string',
|
|
406
|
+
enum: ['UTF-8', 'UTF-16', 'UTF-16BE', 'UTF-32', 'ASCII', 'ISO-8859-1'],
|
|
407
|
+
optional: true,
|
|
408
|
+
default: 'UTF-8',
|
|
409
|
+
},
|
|
410
|
+
],
|
|
411
|
+
returnType: 'string',
|
|
412
|
+
returnDescription: 'The SHA-256 hash of the input as 64 lowercase hexadecimal characters.',
|
|
413
|
+
syntax: 'SHA256(stringToConvert[, charSet])',
|
|
414
|
+
example: '%%=SHA256("This is a string of text.")=%%',
|
|
415
|
+
isConfirmed: true,
|
|
416
|
+
differsFromOfficialDocs: false,
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
name: 'SHA512',
|
|
420
|
+
supportedInCloudPage: true,
|
|
421
|
+
supportedInEmail: true,
|
|
422
|
+
mcnSince: null,
|
|
423
|
+
handlebarsEquivalent: null,
|
|
424
|
+
mcnNotes: null,
|
|
425
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-encryption/mc-ampscript-reference-encryption-sha512.html',
|
|
426
|
+
guideUrl: 'https://ampscript.guide/sha512/',
|
|
427
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/sha512/',
|
|
428
|
+
minArgs: 1,
|
|
429
|
+
maxArgs: 2,
|
|
430
|
+
category: 'Encryption and Encoding',
|
|
431
|
+
description:
|
|
432
|
+
'Returns the SHA-512 hash of the input value. The bytes hashed are the UTF-8 encoding of the input unless charSet names another encoding, and a number or date argument is hashed as the text it renders as.',
|
|
433
|
+
params: [
|
|
434
|
+
{
|
|
435
|
+
name: 'stringToConvert',
|
|
436
|
+
description:
|
|
437
|
+
'The value to hash; a number or date is hashed as its rendered text, and the empty string yields the well-known empty-input digest',
|
|
438
|
+
type: 'string|number|date',
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
name: 'charSet',
|
|
442
|
+
mcnSince: null,
|
|
443
|
+
mcnNotes: null,
|
|
444
|
+
description:
|
|
445
|
+
'Name of the character encoding applied before hashing; any encoding name the platform recognises works, and an unrecognised or empty name aborts the page',
|
|
446
|
+
type: 'string',
|
|
447
|
+
enum: ['UTF-8', 'UTF-16', 'UTF-16BE', 'UTF-32', 'ASCII', 'ISO-8859-1'],
|
|
448
|
+
optional: true,
|
|
449
|
+
default: 'UTF-8',
|
|
450
|
+
},
|
|
451
|
+
],
|
|
452
|
+
returnType: 'string',
|
|
453
|
+
returnDescription: 'The SHA-512 hash of the input as 128 lowercase hexadecimal characters.',
|
|
454
|
+
syntax: 'SHA512(stringToConvert[, charSet])',
|
|
455
|
+
example: "%%=SHA512('This is a string of text.')=%%",
|
|
456
|
+
isConfirmed: true,
|
|
457
|
+
differsFromOfficialDocs: false,
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
name: 'StringToHex',
|
|
461
|
+
supportedInCloudPage: true,
|
|
462
|
+
supportedInEmail: true,
|
|
463
|
+
mcnSince: null,
|
|
464
|
+
handlebarsEquivalent: null,
|
|
465
|
+
mcnNotes: null,
|
|
466
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-to-hex.html',
|
|
467
|
+
guideUrl: 'https://ampscript.guide/stringtohex/',
|
|
468
|
+
minArgs: 1,
|
|
469
|
+
maxArgs: 2,
|
|
470
|
+
category: 'Encryption and Encoding',
|
|
471
|
+
description:
|
|
472
|
+
'Converts a string to its hexadecimal representation. The bytes rendered are the UTF-8 encoding of the input unless charSet names another encoding.',
|
|
473
|
+
params: [
|
|
474
|
+
{
|
|
475
|
+
name: 'sourceString',
|
|
476
|
+
description:
|
|
477
|
+
'The string to convert to hexadecimal character codes; the empty string yields the empty string',
|
|
478
|
+
type: 'string',
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
name: 'charSet',
|
|
482
|
+
description:
|
|
483
|
+
'Character set to use for encoding; any encoding name the platform recognises works, and an unrecognised or empty name aborts the page',
|
|
484
|
+
type: 'string',
|
|
485
|
+
enum: ['UTF-8', 'UTF-16', 'UTF-16BE', 'UTF-32', 'ASCII', 'ISO-8859-1'],
|
|
486
|
+
optional: true,
|
|
487
|
+
default: 'UTF-8',
|
|
488
|
+
},
|
|
489
|
+
],
|
|
490
|
+
returnType: 'string',
|
|
491
|
+
returnDescription:
|
|
492
|
+
'The hexadecimal representation of the input string, in lowercase digits with no separators.',
|
|
493
|
+
syntax: 'StringToHex(sourceString[, charSet])',
|
|
494
|
+
example: "%%=StringToHex('AB')=%%",
|
|
495
|
+
isConfirmed: true,
|
|
496
|
+
differsFromOfficialDocs: false,
|
|
497
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/stringtohex/',
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
name: 'URLEncode',
|
|
501
|
+
supportedInCloudPage: true,
|
|
502
|
+
supportedInEmail: true,
|
|
503
|
+
mcnSince: null,
|
|
504
|
+
handlebarsEquivalent: null,
|
|
505
|
+
mcnNotes: null,
|
|
506
|
+
docUrl: 'https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-http/mc-ampscript-reference-http-url-encode.html',
|
|
507
|
+
guideUrl: 'https://ampscript.guide/urlencode/',
|
|
508
|
+
minArgs: 1,
|
|
509
|
+
maxArgs: 3,
|
|
510
|
+
category: 'Encryption and Encoding',
|
|
511
|
+
description:
|
|
512
|
+
'URL-encodes a string for safe inclusion in a URL. By default only the part after a question mark is touched, so a value that is not a URL passes through unchanged unless the third argument is switched on.',
|
|
513
|
+
isConfirmed: true,
|
|
514
|
+
differsFromOfficialDocs: false,
|
|
515
|
+
sfmcGuideUrl: 'https://sfmc.guide/engagement/ampscript/functions/urlencode/',
|
|
516
|
+
params: [
|
|
517
|
+
{
|
|
518
|
+
name: 'urlToEncode',
|
|
519
|
+
description: 'The string to convert to a format that is safe to include in URLs',
|
|
520
|
+
type: 'string|number',
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
name: 'encodeAllChars',
|
|
524
|
+
mcnSince: null,
|
|
525
|
+
mcnNotes: null,
|
|
526
|
+
description:
|
|
527
|
+
'When switched on, every reserved character of the query string is percent-encoded and spaces become plus signs; when off, only spaces are encoded, as %20. Accepts 1/0, true/false, or those spellings quoted. Defaults to off',
|
|
528
|
+
type: 'string|boolean|number',
|
|
529
|
+
optional: true,
|
|
530
|
+
default: false,
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
name: 'encodeAllStrings',
|
|
534
|
+
description:
|
|
535
|
+
'When switched on, the whole input is encoded even if it is not a URL; when off, only the part after a question mark is encoded. Accepts 1/0, true/false, or those spellings quoted. Defaults to off',
|
|
536
|
+
type: 'string|boolean|number',
|
|
537
|
+
optional: true,
|
|
538
|
+
},
|
|
539
|
+
],
|
|
540
|
+
returnType: 'string',
|
|
541
|
+
returnDescription: 'The URL-encoded representation of the input.',
|
|
542
|
+
syntax: 'URLEncode(urlToEncode[, encodeAllChars, encodeAllStrings])',
|
|
543
|
+
example: "%%=URLEncode('hello world')=%%",
|
|
544
|
+
},
|
|
545
|
+
];
|