-
Notifications
You must be signed in to change notification settings - Fork 0
/
.local.manifest.json
489 lines (489 loc) · 65.9 KB
/
.local.manifest.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
{
"instanceDetails": {
"instance": "Avagate3",
"parentMID": "534001218",
"activeMID": "534001218"
},
"contentBuilder": {
"folders": [
{
"id": 103522,
"name": "Basetime Preference Center",
"parentId": 35088,
"categoryType": "asset",
"rootFolder": true,
"folderPath": "Content Builder/Basetime Preference Center"
},
{
"id": 103523,
"name": "backend",
"parentId": 103522,
"categoryType": "asset",
"rootFolder": false,
"folderPath": "Content Builder/Basetime Preference Center/backend"
},
{
"id": 103524,
"name": "configurations",
"parentId": 103522,
"categoryType": "asset",
"rootFolder": false,
"folderPath": "Content Builder/Basetime Preference Center/configurations"
},
{
"id": 103525,
"name": "frontend",
"parentId": 103522,
"categoryType": "asset",
"rootFolder": false,
"folderPath": "Content Builder/Basetime Preference Center/frontend"
},
{
"id": 103987,
"name": "lib",
"parentId": 103522,
"categoryType": "asset",
"rootFolder": false,
"folderPath": "Content Builder/Basetime Preference Center/lib"
},
{
"id": 105682,
"name": "basetime",
"parentId": 103524,
"categoryType": "asset",
"rootFolder": false,
"folderPath": "Content Builder/Basetime Preference Center/configurations/basetime"
},
{
"id": 103526,
"name": "components",
"parentId": 103525,
"categoryType": "asset",
"rootFolder": false,
"folderPath": "Content Builder/Basetime Preference Center/frontend/components"
},
{
"id": 103975,
"name": "styles",
"parentId": 103525,
"categoryType": "asset",
"rootFolder": false,
"folderPath": "Content Builder/Basetime Preference Center/frontend/styles"
},
{
"id": 103988,
"name": "ssjs",
"parentId": 103987,
"categoryType": "asset",
"rootFolder": false,
"folderPath": "Content Builder/Basetime Preference Center/lib/ssjs"
},
{
"id": 104161,
"name": "validation",
"parentId": 103987,
"categoryType": "asset",
"rootFolder": false,
"folderPath": "Content Builder/Basetime Preference Center/lib/validation"
},
{
"id": 105683,
"name": "en-us",
"parentId": 105682,
"categoryType": "asset",
"rootFolder": false,
"folderPath": "Content Builder/Basetime Preference Center/configurations/basetime/en-us"
},
{
"id": 105699,
"name": "es-us",
"parentId": 105682,
"categoryType": "asset",
"rootFolder": false,
"folderPath": "Content Builder/Basetime Preference Center/configurations/basetime/es-us"
}
],
"assets": [
{
"id": 106442,
"bldrId": "28b28ba6-d2e6-49e0-96ba-48cd49bfa00b",
"name": "functions",
"customerKey": "860f3a3e-8bc9-448c-aa99-4b1c9e60c09b",
"assetType": {
"id": 220,
"name": "codesnippetblock",
"displayName": "Code Snippet Block"
},
"category": {
"id": 103523,
"name": "backend",
"parentId": 103522,
"folderPath": "Content Builder/Basetime Preference Center/backend"
},
"content": "<script runat=\"server\">\n Platform.Load('core', '1.1')\n\n //updated comment\n</script>"
},
{
"id": 106443,
"bldrId": "86ee5953-5eab-484b-b585-9bddabfd26f0",
"name": "processing_api",
"customerKey": "683f297b-7c48-47b1-97eb-e49d4892ec51",
"assetType": {
"id": 220,
"name": "codesnippetblock",
"displayName": "Code Snippet Block"
},
"category": {
"id": 103523,
"name": "backend",
"parentId": 103522,
"folderPath": "Content Builder/Basetime Preference Center/backend"
},
"content": "<script runat=\"server\">\n Platform.Load(\"core\", \"1.1.1\");\n Platform.Response.SetResponseHeader(\"Access-Control-Allow-Origin\", \"*\");\n Platform.Response.SetResponseHeader('Strict-Transport-Security', 'max-age=200');\n Platform.Response.SetResponseHeader('X-XSS-Protection', '1; mode=block');\n Platform.Response.SetResponseHeader('X-Frame-Options', 'Deny');\n Platform.Response.SetResponseHeader('X-Content-Type-Options', 'nosniff');\n Platform.Response.SetResponseHeader('Referrer-Policy', 'strict-origin-when-cross-origin');\n Platform.Response.SetResponseHeader('Content-Security-Policy', \"default-src 'self'\");\n\n var postData = Platform.Request.GetPostData();\n var postJSON = Platform.Function.ParseJSON(postData);\n\n var action = Platform.Request.GetQueryStringParameter('action');\n var payload = Platform.Request.GetQueryStringParameter('payload');\n\n var brand = Platform.Request.GetQueryStringParameter('brand');\n var locale = Platform.Request.GetQueryStringParameter('locale');\n\n var configPath = 'Content Builder\\\\Basetime Preference Center\\\\configurations' + '\\\\ ' + brand + '\\\\ ' + locale\n var applicationConfigurationPath = configPath + '\\\\app_configuration'\n applicationConfigurationPath = applicationConfigurationPath.replace(/(?<=\\\\)\\ /g, '')\n\n var applicationConfiguration = Platform.Function.ContentBlockByName(applicationConfigurationPath)\n var applicationConfigurationJSON = Platform.Function.ParseJSON(applicationConfiguration)\n var map = applicationConfigurationJSON.map;\n\n var preferenceCenterDataExtensionExternalKey = map.data_extension.preferenceCenterExternalKey;\n\n Platform.Function.ContentBlockByName(map.content_block.ssjs.wsProxy)\n Platform.Function.ContentBlockByName(map.content_block.ssjs.utils)\n\n var fns = {\n utils: util(),\n wsProxy: wsProxy()\n }\n\n var res = '';\n var reqConfig = {};\n\n //Begin API Control Block\n //Run specific set of code/functions based on the 'action' parameter\n //After code is finished, the 'response' function returns the output and 'break' stops the processing\n switch (action) {\n case 'testUnsub':\n var postJSON = {\n \"postData\": [\n [\n {\n \"Name\": \"preferenceUpdatedDate\",\n \"Value\": \"2022-07-20T21:17:46.209Z\"\n },\n {\n \"Name\": \"preference\",\n \"Value\": \"unsubscribe\"\n },\n {\n \"Name\": \"subscriberId\",\n \"Value\": 484239505\n },\n {\n \"Name\": \"emailAddress\",\n \"Value\": \"tony.zupancic@avagate.com\"\n },\n {\n \"Name\": \"channel\",\n \"Value\": \"email\"\n }\n ]\n ],\n \"logUnsubEvent\": {\n \"unsubscribe\": true,\n \"emailAddress\": \"tony.zupancic@avagate.com\",\n \"subscriberKey\": \"tony.zupancic@avagate.com\",\n \"subscriberId\": 484239505,\n \"jobId\": 0\n }\n }\n\n var unsubEvent;\n var logUnsubEvent = postJSON.logUnsubEvent;\n var allSubscribersListID = fns.utils.getAllSubscribersListID(fns)\n var subscriberCurrentStatus = fns.utils.getSubscriberStatus(logUnsubEvent.subscriberId, fns)\n\n if (applicationConfigurationJSON.action_toggles.unsubscribe === true) {\n logUnsubEvent.listId = allSubscribersListID;\n unsubEvent = fns.utils.toggleUnsubscribe(logUnsubEvent, subscriberCurrentStatus, fns)\n }\n\n res = {\n allSubscribersListID: allSubscribersListID,\n subscriberCurrentStatus: subscriberCurrentStatus,\n logUnsubEvent: logUnsubEvent,\n unsubEvent: unsubEvent\n }\n\n break;\n case 'submitPreferenceForm':\n var updateData = postJSON.postData;\n var logUnsubEvent = postJSON.logUnsubEvent || null;\n var unsubscribe = logUnsubEvent.unsubscribe;\n var allSubscribersListID = fns.utils.getAllSubscribersListID(fns)\n var subscriberCurrentStatus = fns.utils.getSubscriberStatus(logUnsubEvent.subscriberId, fns)\n\n // add All Subscribers ListID to UnsubEvent Object\n logUnsubEvent.listId = allSubscribersListID;\n\n var payload = [];\n\n for (var u = 0; u < updateData.length; u++) {\n var update = updateData[u];\n payload.push({\n CustomerKey: preferenceCenterDataExtensionExternalKey,\n Properties: update\n })\n }\n\n //update item\n reqConfig = {\n soapObjName: \"DataExtensionObject\",\n options: {\n SaveOptions: [{\n PropertyName: \"*\",\n SaveAction: \"UpdateAdd\"\n }]\n },\n payload: payload\n }\n var updatePreferences = fns.wsProxy.update(reqConfig);\n\n var unsubEvent;\n if (applicationConfigurationJSON.action_toggles.unsubscribe === true) {\n unsubEvent = fns.utils.toggleUnsubscribe(logUnsubEvent, subscriberCurrentStatus, fns)\n }\n\n res = updatePreferences;\n break;\n\n\n case 'getCurrentPreferences':\n var preferences;\n var preferenceRequest;\n\n reqConfig = {\n dataExtensionKey: preferenceCenterDataExtensionExternalKey,\n cols: [],\n filter: {\n Property: \"subscriberId\",\n SimpleOperator: \"equals\",\n Value: postJSON.subscriberId\n }\n };\n\n preferenceRequest = fns.utils.getDERecords(reqConfig, fns);\n\n if (preferenceRequest.Status === 'OK') {\n // Add Record if it does not exist\n if (preferenceRequest.Results.length === 0) {\n var channels = postJSON.channels;\n var payload = [];\n var updateConfig;\n\n for (var c = 0; c < channels.length; c++) {\n var channel = channels[c];\n\n payload.push({\n CustomerKey: preferenceCenterDataExtensionExternalKey,\n Properties: [\n {\n Name: 'subscriberId',\n Value: postJSON.subscriberId\n },\n {\n Name: 'emailAddress',\n Value: postJSON.emailAddress\n },\n {\n Name: 'channel',\n Value: channel\n }\n ]\n })\n }\n\n //update item\n updateConfig = {\n soapObjName: \"DataExtensionObject\",\n options: {\n SaveOptions: [{\n PropertyName: \"*\",\n SaveAction: \"UpdateAdd\"\n }]\n },\n payload: payload\n }\n\n var addRecords = fns.wsProxy.update(updateConfig);\n preferenceRequest = fns.utils.getDERecords(reqConfig, fns)\n }\n\n preferences = fns.utils.formatResult(preferenceRequest.Results, 'Properties')\n\n res = {\n Status: 'OK',\n Results: preferences\n }\n } else {\n res = preferenceRequest;\n }\n\n break;\n };\n\n fns.utils.response(res)\n\n</script>"
},
{
"id": 106445,
"bldrId": "6fc226e0-4c78-4c42-a24d-e2615c306a41",
"name": "app_html",
"customerKey": "1735a3a0-ecfc-452f-8df3-d1d2234324c3",
"assetType": {
"id": 220,
"name": "codesnippetblock",
"displayName": "Code Snippet Block"
},
"category": {
"id": 103525,
"name": "frontend",
"parentId": 103522,
"folderPath": "Content Builder/Basetime Preference Center/frontend"
},
"content": "<v-app>\n <v-main>\n <v-row overflow=\"hidden\">\n <v-col cols=\"12\">\n <branding-bar @update-dark-mode=\"onUpdateDarkMode\" :application-configuration=\"applicationConfiguration\" :dark-mode=\"darkMode\" :branding=\"branding\"></branding-bar>\n </v-col>\n </v-row>\n <v-row v-show=\"authorized\">\n <v-col cols=\"2\">\n <channel-drawer @update-channel-selection=\"onUpdateChannelSelection\" :channels=\"channels\" :branding=\"branding\"\n :preference-options=\"preferenceOptions\"></channel-drawer>\n </v-col>\n <v-col cols=\"10\">\n <preference-form @submit-preference-form=\"onSubmitPreferenceForm\" :channels=\"channels\" :subscriber-preferences=\"subscriber.preferences\" :form-submitting=\"formSubmitting\"\n :branding=\"branding\" :preference-options=\"preferenceOptions\" :channel-selection=\"channelSelection\">\n </preference-form>\n </v-col>\n </v-row>\n <v-row v-show=\"!authorized\">\n <unauthorized-user :branding=\"branding\" :unauthorized=\"preferenceOptions.unauthorized\">\n </unauthorized-user>\n </v-row>\n <v-row>\n <legal :branding=\"branding\" :legal=\"preferenceOptions.legal\">\n </legal>\n </v-row>\n </v-main>\n</v-app>"
},
{
"id": 106446,
"bldrId": "6703c08e-bddd-4b17-b55f-977e499d1a4b",
"name": "app_js",
"customerKey": "9d6e90b9-698b-4279-9c20-c69f6b9fe29e",
"assetType": {
"id": 220,
"name": "codesnippetblock",
"displayName": "Code Snippet Block"
},
"category": {
"id": 103525,
"name": "frontend",
"parentId": 103522,
"folderPath": "Content Builder/Basetime Preference Center/frontend"
},
"content": "new Vue({\n el: '#app',\n vuetify: new Vuetify(),\n data() {\n return {\n authorized: isAuthorized === 1 ? true : false,\n darkMode: false,\n debug: true,\n channels: [],\n applicationConfiguration,\n preferenceOptions,\n channelSelection,\n formSubmitting: false,\n brand: brand,\n locale: locale,\n subscriber: {\n subscriberId: subscriberId,\n subscriberKey: subscriberKey,\n emailAddress: emailAddress,\n jobId: jobId,\n preferences: []\n }\n }\n },\n beforeMount() {\n this.getPreferenceChannels();\n },\n mounted() {\n this.debug && this.debugData();\n this.getExistingPreferences();\n },\n methods: {\n debugData() {\n console.log({\n config: this.applicationConfiguration,\n preferenceOptions: this.preferenceOptions\n })\n },\n getPreferenceChannels(preferenceOptions) {\n this.channels = Object.keys(this.preferenceOptions.channels)\n },\n getDefaultChannelSelection() {\n const channels = this.channels;\n this.channelSelection = channels[0];\n },\n async getExistingPreferences() {\n try {\n const subscriberId = this.subscriber.subscriberId;\n const emailAddress = this.subscriber.emailAddress;\n const submitRequest = await axios.post(`${this.apiBaseURL}getCurrentPreferences`, {\n subscriberId,\n channels: this.channels,\n emailAddress\n })\n\n console.log(submitRequest)\n\n if (submitRequest.data.Status === 'OK') {\n this.subscriber.preferences = submitRequest.data.Results;\n }\n\n } catch (err) {\n console.log(err)\n }\n },\n onUpdateDarkMode() {\n this.darkMode = !this.darkMode\n },\n onUpdateChannelSelection($event) {\n this.channelSelection = $event\n },\n async onSubmitPreferenceForm($event) {\n try {\n const channels = this.channels;\n const postData = [];\n\n for (const c in channels) {\n const channel = channels[c];\n let unsubscribe = false;\n let channelProperties = new Array();\n\n if (Object.prototype.hasOwnProperty.call($event, 'profile')) {\n const profileData = $event.profile;\n\n if (profileData.hasUpdatedValues) {\n channelProperties.push({\n Name: 'profileUpdatedDate',\n Value: new Date()\n })\n\n\n for (const pro in profileData) {\n channelProperties.push({\n Name: pro,\n Value: profileData[pro]\n })\n }\n }\n }\n\n\n if (Object.prototype.hasOwnProperty.call($event[channel], 'preferences')) {\n const preferenceData = $event[channel]['preferences'];\n\n if (preferenceData.hasUpdatedValues) {\n channelProperties.push({\n Name: 'preferenceUpdatedDate',\n Value: new Date()\n })\n\n for (const pre in preferenceData) {\n let preferenceValue = preferenceData[pre]\n \n channelProperties.push({\n Name: pre,\n Value: preferenceValue\n })\n }\n }\n\n }\n\n if (Object.prototype.hasOwnProperty.call($event[channel], 'subscriptions')) {\n const subscriptionObject = $event[channel]['subscriptions'];\n const subscriptionsData = subscriptionObject.subscriptions;\n\n if (subscriptionObject.hasUpdatedValues) {\n channelProperties.push({\n Name: 'subscriptionsUpdatedDate',\n Value: new Date()\n })\n\n let subscriptions = ''\n for (const sub of subscriptionsData) {\n subscriptions += `${sub}|`\n }\n\n subscriptions = subscriptions.substring(0, subscriptions.length - 1)\n channelProperties.push({\n Name: 'subscriptions',\n Value: subscriptions\n })\n\n }\n }\n\n if (\n $event[channel]['subscriptions']['hasUpdatedValues'] ||\n $event[channel]['preferences']['hasUpdatedValues'] ||\n $event['profile']['hasUpdatedValues']\n ) {\n channelProperties.push(\n {\n Name: 'subscriberId',\n Value: this.subscriber.subscriberId\n },\n {\n Name: 'emailAddress',\n Value: this.subscriber.emailAddress\n },\n {\n Name: 'channel',\n Value: channel\n })\n }\n\n let propertyArray = channelProperties.map(prop => prop.Name !== 'hasUpdatedValues' && prop)\n\n if (propertyArray.length) {\n postData.push(propertyArray.filter(Boolean))\n }\n\n channelProperties = new Array();\n }\n\n let unsubscribe = false;\n\n if(postData.length === 1){\n const isEmailChannel = postData[0].filter((obj) => obj.Value === 'email')\n if(isEmailChannel){\n let preference = postData[0].filter((obj) => obj.Name === 'preference')\n let subscriptions = postData[0].filter((obj) => obj.Name === 'subscriptions')\n\n preference = preference.length && preference[0].Value.toLowerCase();\n subscriptions = subscriptions.length && subscriptions[0].Value.toLowerCase();\n\n if(preference && preference.includes('unsubscribe') || subscriptions && subscriptions.includes('unsubscribe')){\n unsubscribe = true;\n }\n }\n }\n\n\n const submitRequest = await axios.post(`${this.apiBaseURL}submitPreferenceForm`, {\n postData,\n logUnsubEvent: {\n unsubscribe,\n emailAddress,\n subscriberKey,\n subscriberId,\n jobId\n }\n })\n\n if(submitRequest.data.Status === 'OK'){\n Vue.$toast.success(`Thank you for updating your preferences!`)\n this.getExistingPreferences();\n }\n \n\n } catch (err) {\n console.log(err)\n Vue.$toast.success(`There was an error: [${err.message}]`)\n }\n }\n },\n computed: {\n apiBaseURL() {\n return `${this.applicationConfiguration.apiBaseURL}?brand=${this.brand}&locale=${this.locale}&action=`\n },\n branding() {\n if (this.applicationConfiguration.branding.supportDarkMode && this.darkMode) {\n return this.applicationConfiguration.branding.dark\n }\n\n return this.applicationConfiguration.branding.default\n }\n }\n})"
},
{
"id": 106447,
"bldrId": "93f3f5f5-926b-439f-8860-ea74076de070",
"name": "_component_imports",
"customerKey": "1905a823-e046-472b-aecd-1794eba63433",
"assetType": {
"id": 220,
"name": "codesnippetblock",
"displayName": "Code Snippet Block"
},
"category": {
"id": 103526,
"name": "components",
"parentId": 103525,
"folderPath": "Content Builder/Basetime Preference Center/frontend/components"
},
"content": "%%=TreatAsContent(ContentBlockByName('Content Builder\\Basetime Preference Center\\frontend\\styles\\submit_button_animation'))=%%\n%%=TreatAsContent(ContentBlockByName('Content Builder\\Basetime Preference Center\\lib\\validation\\subscriber_validation'))=%%\n\n<script runat=\"server\">\n Platform.Load(\"core\", \"1.1.1\");\n\n var brand = Platform.Request.GetQueryStringParameter('brand')\n var locale = Platform.Request.GetQueryStringParameter('locale')\n\n var configPath = 'Content Builder\\\\Basetime Preference Center\\\\configurations' + '\\\\ ' + brand + '\\\\ ' + locale\n var applicationConfigurationPath = configPath + '\\\\app_configuration'\n var preferenceOptionsPath = configPath + '\\\\preference_options'\n\n applicationConfigurationPath = applicationConfigurationPath.replace(/(?<=\\\\)\\ /g, '')\n preferenceOptionsPath = preferenceOptionsPath.replace(/(?<=\\\\)\\ /g, '')\n\n var applicationConfiguration = Platform.Function.ContentBlockByName(applicationConfigurationPath)\n var preferenceOptions = Platform.Function.ContentBlockByName(preferenceOptionsPath)\n var applicationConfigurationJSON = Platform.Function.ParseJSON(applicationConfiguration)\n var map = applicationConfigurationJSON.map;\n\n var channelDrawer = Platform.Function.ContentBlockByName(map.content_block.channel_drawer)\n var preferenceForm = Platform.Function.ContentBlockByName(map.content_block.preference_form)\n var unauthorizedUser = Platform.Function.ContentBlockByName(map.content_block.unauthorized_user)\n var brandingBar = Platform.Function.ContentBlockByName(map.content_block.branding_bar)\n var legal = Platform.Function.ContentBlockByName(map.content_block.legal)\n var appJS = Platform.Function.ContentBlockByName(map.content_block.app_js)\n\n</script>\n\n%%=Concat('<sc','rip','t>')=%%\n\n Vue.use(VueToast, {\n position: 'top-right',\n duration: 6000,\n dismissable: true\n });\n\n Vue.use(VueFormulate)\n\n const applicationConfiguration = <ctrl:var name=applicationConfiguration />\n const preferenceOptions = <ctrl:var name=preferenceOptions />\n\n const channelKeys = Object.keys(preferenceOptions.channels);\n const channelSelection = channelKeys[0];\n\n const isAuthorized = <ctrl:var name=authorized />\n const subscriberId = <ctrl:var name=subscriberId />\n const emailAddress = <ctrl:var name=emailAddress />\n const subscriberKey = <ctrl:var name=subscriberKey />\n const jobId = <ctrl:var name=jobId />\n const brand = \"<ctrl:var name=brand />\"\n const locale = \"<ctrl:var name=locale />\"\n\n <ctrl:var name=appJS />\n <ctrl:var name=brandingBar />\n <ctrl:var name=channelDrawer />\n <ctrl:var name=preferenceForm />\n <ctrl:var name=unauthorizedUser />\n <ctrl:var name=legal />\n\n %%=Concat('</sc','rip','t>')=%%"
},
{
"id": 106793,
"bldrId": "898ad7fe-d0e6-4e67-9dbb-4924484eea28",
"name": "channel_drawer",
"customerKey": "91082bde-88de-4630-992e-b61172208ba0",
"assetType": {
"id": 220,
"name": "codesnippetblock",
"displayName": "Code Snippet Block"
},
"category": {
"id": 103526,
"name": "components",
"parentId": 103525,
"folderPath": "Content Builder/Basetime Preference Center/frontend/components"
},
"content": "/*\nWhat is this component?\n*/\nVue.component('channel-drawer', {\n props: {\n preferenceOptions: Object,\n branding: Object,\n channels: Array\n },\n methods: {\n getChannelIcon: function (channel, preferenceOptions) {\n return this.preferenceOptions['channels'][channel]['icon']\n }\n },\n data() {\n return {\n right: null,\n }\n },\n template: `\n <div \n v-if=\"channels.length > 1\"\n >\n <v-navigation-drawer \n permanent\n max-height=\"100vh\"\n height=\"80vh\"\n >\n <v-list dense nav>\n <v-list-item v-for=\"channel in channels\" :key=\"channel\" @click=\"$emit('update-channel-selection', channel)\" link>\n <v-list-item-icon>\n <v-icon\n large\n :color=\"branding.colors.accent\"\n >{{ getChannelIcon(channel, this.preferenceOptions) }}</v-icon>\n </v-list-item-icon>\n\n <v-list-item-content>\n <v-list-item-title class=\"text-h6 mb-8\">{{ channel }}</v-list-item-title>\n </v-list-item-content>\n </v-list-item>\n </v-list>\n </v-navigation-drawer>\n</div>\n`\n})"
},
{
"id": 106938,
"bldrId": "7b6baf70-f69f-4a01-afd2-67cd81bc332c",
"name": "branding_bar",
"customerKey": "2e504d94-75b5-46e3-9b3c-1b0cb32d3be0",
"assetType": {
"id": 220,
"name": "codesnippetblock",
"displayName": "Code Snippet Block"
},
"category": {
"id": 103526,
"name": "components",
"parentId": 103525,
"folderPath": "Content Builder/Basetime Preference Center/frontend/components"
},
"content": "/*\nWhat is this component?\n*/\nVue.component('branding-bar', {\nprops: {\nbranding: Object,\napplicationConfiguration: Object\n},\nmounted() {\n\n},\ndata() {\nreturn {\ndarkModeToggle: false\n}\n},\nwatch: {\n\n},\nmethods: {\n\n},\ntemplate: `\n<div>\n <v-card>\n <v-app-bar :color=\"branding.colors.paper\" position=\"absolute\" height=\"100\">\n <!-- <v-app-bar-nav-icon></v-app-bar-nav-icon> -->\n\n <v-toolbar-title>\n <v-img height=\"100%\" width=\"auto\" :src=\"branding.logo\"></v-img>\n </v-toolbar-title>\n\n <v-spacer></v-spacer>\n \n <v-switch v-show=\"applicationConfiguration.branding.supportDarkMode\" :color=\"branding.colors.accent\" @click=\"$emit('update-dark-mode')\" v-model=\"darkModeToggle\">\n <template v-slot:label>\n <v-icon v-if=\"darkModeToggle\" large color=\"#F5F5F5\">\n mdi-moon-waxing-crescent\n </v-icon>\n <v-icon v-else large color=\"#616161\">\n mdi-white-balance-sunny\n </v-icon>\n </template>\n </v-switch>\n\n </v-app-bar>\n </v-card>\n</div>\n`\n})"
},
{
"id": 107200,
"bldrId": "ffdc0793-808e-430b-92dd-3046058b26db",
"name": "preference_form",
"customerKey": "3c12df57-2242-49c8-8eba-e5bfdb7b1a12",
"assetType": {
"id": 220,
"name": "codesnippetblock",
"displayName": "Code Snippet Block"
},
"category": {
"id": 103526,
"name": "components",
"parentId": 103525,
"folderPath": "Content Builder/Basetime Preference Center/frontend/components"
},
"content": "\n\n/*\nWhat is this component?\n*/\nVue.component('preference-form', {\n props: {\n branding: Object,\n preferenceOptions: Object,\n channels: Array,\n channelSelection: String,\n formSubmitting: Boolean,\n subscriberPreferences: Array\n },\n beforeMount() {\n this.setFormInputSchema();\n this.setProfileFormSchema();\n this.setPreferenceFormSchema();\n this.setSubscriptionFormSchema();\n\n this.setFormInputValues('preferences')\n this.setFormInputValues('subscriptions')\n },\n data() {\n return {\n profileFormSchema: [],\n preferenceFormSchema: [],\n subscriptionFormSchema: [],\n formInputs: {}\n }\n },\n methods: {\n submitPreferenceForm() {\n const channels = this.channels;\n let emit = this.formInputs\n emit.profile.hasUpdatedValues = this.checkForUpdatedValues(emit.profile, this.channelPreferences)\n\n for (const c in channels) {\n const channel = channels[c];\n const channelPreferences = this.setChannelPreferences(channel);\n const subscriptions = channelPreferences.subscriptions.split(\"|\")\n\n emit[channel]['preferences']['hasUpdatedValues'] = this.checkForUpdatedValues(emit[channel]['preferences'], channelPreferences)\n\n emit[channel]['subscriptions']['hasUpdatedValues'] = this.checkForUpdatedValues(emit[channel]['subscriptions'].subscriptions, subscriptions)\n }\n\n this.$emit('submit-preference-form', emit)\n },\n checkForUpdatedValues(updateObject, existingObject) {\n \n for (const u in updateObject) {\n const updatedProfileValue = updateObject[u];\n const existingProfileValue = existingObject[u];\n\n if(u !== 'hasUpdatedValues'){\n if (updatedProfileValue !== existingProfileValue) {\n return true;\n }\n }\n }\n\n return false;\n },\n setProfileFormSchema() {\n let profileSchema = [\n {\n \"component\": \"h2\",\n \"children\": `${this.preferenceOptions['profile']['headline']}`\n },\n {\n \"component\": \"p\",\n \"children\": `${this.preferenceOptions['profile']['copy']}`\n }\n ]\n\n if (\n Object.prototype.hasOwnProperty.call(this.preferenceOptions.profile, 'inputs')\n ) {\n const profileData = this.preferenceOptions.profile.inputs;\n\n for (const pro in profileData) {\n let inputObject = profileData[pro];\n \n this.formInputs['profile'][inputObject.name] = this.channelPreferences[inputObject.name] ? this.channelPreferences[inputObject.name] : '';\n\n profileSchema.push(inputObject)\n }\n }\n\n this.profileFormSchema = profileSchema\n },\n setPreferenceFormSchema() {\n let preferenceSchema = [\n {\n \"component\": \"h2\",\n \"children\": `${this.preferenceChannelConfiguration['preferences']['headline']}`\n },\n {\n \"component\": \"p\",\n \"children\": `${this.preferenceChannelConfiguration['preferences']['copy']}`\n }\n ]\n\n if (\n Object.prototype.hasOwnProperty.call(this.preferenceChannelConfiguration['preferences'], 'radios')\n ) {\n preferenceSchema.push({\n \"name\": \"preference\",\n \"type\": \"radio\",\n \"options\": this.preferenceChannelConfiguration['preferences']['radios']\n })\n }\n\n this.preferenceFormSchema = preferenceSchema\n },\n setSubscriptionFormSchema() {\n let subscriptionSchema = [\n {\n \"component\": \"h2\",\n \"children\": `${this.preferenceChannelConfiguration['subscriptions']['headline']}`\n },\n {\n \"component\": \"p\",\n \"children\": `${this.preferenceChannelConfiguration['subscriptions']['copy']}`\n }\n ]\n\n if (!Object.prototype.hasOwnProperty.call(this.formInputs[channelSelection], 'subscriptions')) {\n this.formInputs[channelSelection]['subscriptions'] = {};\n }\n\n\n if (\n Object.prototype.hasOwnProperty.call(this.preferenceChannelConfiguration['subscriptions'], 'checkboxes')\n ) {\n subscriptionSchema.push({\n \"name\": \"subscriptions\",\n \"type\": \"checkbox\",\n \"options\": this.preferenceChannelConfiguration['subscriptions']['checkboxes']\n })\n }\n\n this.subscriptionFormSchema = subscriptionSchema\n },\n setFormInputSchema() {\n this.formInputs = {\n profile: {}\n };\n\n this.channels.forEach(channel => {\n this.formInputs[channel] = {}\n })\n },\n setFormInputValues(objectKey) {\n const channels = this.channels;\n\n for (const c in channels) {\n switch (objectKey) {\n case 'preferences':\n if (!Object.prototype.hasOwnProperty.call(this.formInputs[channels[c]], 'preferences')) {\n this.formInputs[channels[c]]['preferences'] = {};\n }\n\n this.formInputs[channels[c]]['preferences']['preference'] = this.setChannelPreferences(channels[c])['preference'];\n break;\n case 'subscriptions':\n if (!Object.prototype.hasOwnProperty.call(this.formInputs[channels[c]], 'subscriptions')) {\n this.formInputs[channels[c]]['subscriptions'] = {};\n }\n\n this.formInputs[channels[c]]['subscriptions']['subscriptions'] = this.setChannelPreferences(channels[c])['subscriptions'].split(\"|\") || [];\n break;\n }\n }\n\n },\n setChannelPreferences(channel) {\n if(this.subscriberPreferences.length) {\n return this.subscriberPreferences.find((pref) => pref.channel === channel)\n }\n }\n },\n watch: {\n channelSelection: function (newVal, oldVal) {\n this.setProfileFormSchema();\n this.setPreferenceFormSchema();\n this.setSubscriptionFormSchema();\n }\n },\n computed: {\n preferenceChannelConfiguration() {\n if (this.channelSelection) {\n return this.preferenceOptions['channels'][this.channelSelection]\n }\n },\n channelPreferences() {\n if (this.channelSelection) {\n return this.subscriberPreferences.find((pref) => pref.channel === this.channelSelection)\n }\n },\n },\n template: `\n<section>\n <v-row class=\"flex\">\n <v-col cols=\"12\" class=\"justify-center\">\n <div v-show=\"preferenceOptions.profile.inputs\">\n <formulate-form :values=\"formInputs['profile']\" v-model=\"formInputs['profile']\" :schema=\"profileFormSchema\" />\n </div>\n </v-col>\n </v-row>\n\n <v-row>\n <v-col cols=\"12\" md=\"8\">\n <v-divider class=\"my-5\"></v-divider>\n </v-col>\n </v-row>\n\n <v-row class=\"flex\">\n <v-col cols=\"12\" md=\"4\" class=\"mb-xs-4 mb-md-0\">\n <div v-show=\"channelSelection\">\n <formulate-form :values=\"formInputs[channelSelection]['preferences']\" v-model=\"formInputs[channelSelection]['preferences']\" :schema=\"preferenceFormSchema\" />\n </div>\n </v-col>\n <v-col cols=\"12\" md=\"4\">\n <div v-show=\"channelSelection\">\n <formulate-form :values=\"formInputs[channelSelection]['subscriptions']\" v-model=\"formInputs[channelSelection]['subscriptions']\" :schema=\"subscriptionFormSchema\" />\n </div>\n </v-col>\n </v-row>\n\n <v-row>\n <v-col cols=\"12\" md=\"8\">\n <v-btn class=\"ma-2\" :loading=\"formSubmitting\" :disabled=\"formSubmitting\" color=\"info\" @click=\"submitPreferenceForm\">\n Submit Updates\n <template v-slot:loader>\n <span class=\"custom-loader\">\n <v-icon light>mdi-cached</v-icon>\n </span>\n </template>\n </v-btn>\n </v-col>\n </v-row>\n</section>\n`\n})"
},
{
"id": 107340,
"bldrId": "8111eb7f-60e2-45f1-a170-d813d92867ff",
"name": "submit_button_animation",
"customerKey": "392f23f9-9f48-496b-90f4-0a5105edd768",
"assetType": {
"id": 220,
"name": "codesnippetblock",
"displayName": "Code Snippet Block"
},
"category": {
"id": 103975,
"name": "styles",
"parentId": 103525,
"folderPath": "Content Builder/Basetime Preference Center/frontend/styles"
},
"content": "<style>\n .custom-loader {\n animation: loader 1s infinite;\n display: flex;\n }\n @-moz-keyframes loader {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(360deg);\n }\n }\n @-webkit-keyframes loader {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(360deg);\n }\n }\n @-o-keyframes loader {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(360deg);\n }\n }\n @keyframes loader {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(360deg);\n }\n }\n</style>"
},
{
"id": 107374,
"bldrId": "b2ed6a8e-c811-47a7-8bf8-350dc730e81d",
"name": "wsProxy",
"customerKey": "d7bc6c6f-e41e-404a-bb5c-55316681c26d",
"assetType": {
"id": 220,
"name": "codesnippetblock",
"displayName": "Code Snippet Block"
},
"category": {
"id": 103988,
"name": "ssjs",
"parentId": 103987,
"folderPath": "Content Builder/Basetime Preference Center/lib/ssjs"
},
"content": "<script runat=\"server\">\n Platform.Load(\"core\", \"1.1\");\n\n function wsProxy() {\n var prox = new Script.Util.WSProxy();\n var fn = {};\n\n /*******************************\n * @config {<Object>}\n * @continueRequest {Boolean}\n * @return {Array}\n ******************************/\n fn.retrieve = function (config, continueRequest) {\n\n var reqID;\n var moreData = true;\n var continueRequest = continueRequest ? continueRequest : false;\n var obj = config.soapObjName ? config.soapObjName : null;\n var opts = config.opts ? config.opts : {};\n var props = config.props ? config.props : {};\n var filter = config.filter ? config.filter : {};\n var cols = config.cols ? config.cols : null;\n var mid = config.mid ? config.mid : null;\n // prox = mid ? util.proxyContext(prox, mid) : prox;\n\n if (!config) { return 'configuration required'; }\n if (!obj) { return 'SOAP object is required'; }\n\n var resultsOut = [];\n\n var data = prox.retrieve(obj, cols, filter, opts, props)\n\n return data\n\n } // end retrieve\n\n /*******************************\n * @config {Object}\n * @return {Object}\n ******************************/\n fn.update = function (config) {\n var obj = config.soapObjName ? config.soapObjName : null;\n var payload = config.payload ? config.payload : null;\n var options = config.options ? config.options : null;\n var mid = config.mid ? config.mid : null;\n // prox = mid ? utils.proxyContext(prox, mid) : prox;\n\n if (!config) { return 'configuration required'; }\n if (!obj) { return 'SOAP object is required'; }\n if (!payload) { return 'payload is required'; }\n\n var batch = fns.utils.isArray(payload)\n\n if (batch) {\n var res = prox.updateBatch(obj, payload, options);\n } else {\n var res = prox.updateItem(obj, payload, options);\n }\n\n return res;\n } // end update\n\n\n return fn\n }\n\n</script>"
},
{
"id": 107746,
"bldrId": "c6c91d78-0e7c-4e64-8bed-fa2bc4610af4",
"name": "subscriber_validation",
"customerKey": "687968b9-0253-4ae5-930b-24b113ed07ad",
"assetType": {
"id": 220,
"name": "codesnippetblock",
"displayName": "Code Snippet Block"
},
"category": {
"id": 104161,
"name": "validation",
"parentId": 103987,
"folderPath": "Content Builder/Basetime Preference Center/lib/validation"
},
"content": "%%[\n set @subscriberkey = AttributeValue(\"_subscriberkey\")\n set @subscriberid = AttributeValue(\"subscriberid\")\n set @emailAddress = AttributeValue(\"emailaddr\")\n set @jobid = AttributeValue(\"jobid\")\n]%%\n\n<script runat=\"server\">\n Platform.Load(\"core\", \"1.1.1\");\n\n var subscriberKey = Stringify(Variable.GetValue(\"@subscriberkey\"));\n var emailAddress = Stringify(Variable.GetValue(\"@emailAddress\"));\n var subscriberId = Variable.GetValue(\"@subscriberid\");\n var jobId = Variable.GetValue(\"@jobid\");\n\n var authorized = 0;\n if(subscriberId !== 0 && jobId !== 0) {\n authorized = 1;\n }\n\n authorized = 1\n\n</script>"
},
{
"id": 107911,
"bldrId": "cec8d97a-f694-4906-bd94-6a8891310a52",
"name": "unauthorized_user",
"customerKey": "fa95807c-01d4-492d-af21-2898222e4bbc",
"assetType": {
"id": 220,
"name": "codesnippetblock",
"displayName": "Code Snippet Block"
},
"category": {
"id": 103526,
"name": "components",
"parentId": 103525,
"folderPath": "Content Builder/Basetime Preference Center/frontend/components"
},
"content": "/*\nWhat is this component?\n*/\nVue.component('unauthorized-user', {\nprops: {\n unauthorized: Object,\n branding: Object\n},\nmounted() {\n\n},\ndata() {\nreturn {\n\n}\n},\nwatch: {\n\n},\nmethods: {\n\n},\ntemplate: `\n<v-col cols=\"10\" class=\"flex text-center mx-auto\">\n <v-row justify=\"space-around\">\n <v-icon :color=\"branding.colors.accent\" size=\"200\" aria-label=\"My Account\" role=\"img\" aria-hidden=\"false\">\n {{unauthorized.icon}}\n </v-icon>\n </v-row>\n <v-row justify=\"space-around\">\n <v-col cols=\"8\" class=\"text-h6 text-md-h5\">\n <span v-html=\"unauthorized.copy\"></span>\n </v-col>\n </v-row>\n\n</v-col>\n`\n})"
},
{
"id": 107940,
"bldrId": "69f852b0-e5c0-419d-ba07-3ace0496f41e",
"name": "utils",
"customerKey": "dadb2954-0bef-4859-b8bb-3570a5e76831",
"assetType": {
"id": 220,
"name": "codesnippetblock",
"displayName": "Code Snippet Block"
},
"category": {
"id": 103988,
"name": "ssjs",
"parentId": 103987,
"folderPath": "Content Builder/Basetime Preference Center/lib/ssjs"
},
"content": "<script runat=\"server\">\n Platform.Load(\"core\", \"1.1.1\");\n\n function util() {\n var fn = {}\n\n fn.isArray = function (arg) {\n return Object.prototype.toString.call(arg) === '[object Array]';\n }\n\n\n fn.response = function (arg) {\n Write(Stringify(arg))\n }\n\n\n fn.proxyContext = function (prox, mid) {\n if (mid) {\n //reset previous settings\n prox.resetClientIds();\n // Set ClientID \n prox.setClientId({\n \"ID\": mid\n });\n }\n return prox\n }\n\n\n fn.deBug = function (action, response, logExtKey, debug) {\n if (response) {\n debug ? Write(\"<br><b>\" + action + \":</b><br> \" + Stringify(response) + \"<br><br>\") : null;\n } else {\n debug ? Write(\"<br><b>\" + action + \"</b><br> \") : null;\n }\n\n if (logExtKey) {\n var log = {\n action: action ? action : null,\n log: response ? response : null\n }\n\n addLog(log, logExtKey);\n }\n }\n\n\n /***********************************************\n *\n * function addLog()\n * Pushes logging object to array to be written to a Data Extension\n * \n * @param obj {Object} logging object that matches the data extension\n * @param logExtKey {String} External Key to log records to\n * \n ***********************************************/\n fn.addLog = function (obj, logExtKey) {\n var logDE = DataExtension.Init(logExtKey);\n var logAction = logDE.Rows.Add(obj);\n };\n\n\n\n /*\n getDERecords Function\n Retrieves rows from a Data Extension\n \n Dependencies:\n - DEData Function\n @config {object} object with payload for wsProxy call\n \n //Sample Usage\n \n var config = {\n deName: \"Data Extension Name\",\n col: [],\n filter: {\n Property: \"EmailAddress\",\n SimpleOperator: \"isNotNull\",\n Value: \"\"\n },\n opts: {\n BatchSize: 10\n }\n };\n \n var data = getDERecords(config);\n \n //optional//\n If only specific fields are needed, add a cols array of those fields.\n When no cols key is included, function will get all fields.\n \n var config = {\n deName: \"Data Extension Name\",\n cols: [\"EmailAddress\", \"SubscriberKey\"]\n filter: {\n Property: \"EmailAddress\",\n SimpleOperator: \"isNotNull\",\n Value: \"\"\n },\n opts: {\n BatchSize: 10\n }\n };\n \n */\n fn.getDERecords = function (config, fns) {\n\n var deConfig = {\n soapObjName: \"DataExtensionObject[\" + config.dataExtensionKey + \"]\"\n };\n\n deConfig.cols = config.cols.length > 0 ? config.cols : fns.utils.getFieldNames(config.dataExtensionKey);\n if (config.filter) { deConfig.filter = config.filter; };\n if (config.opts) { deConfig.opts = config.opts; };\n\n var deRecords = fns.wsProxy.retrieve(deConfig);\n return deRecords;\n };\n\n\n\n\n /***********************************************\n *\n * function getFieldNames()\n * Gets all columns from a SOAP Object\n *\n * @peram {deName} Name of DataExtension to get columns\n *\n * @output {array} array of fields\n *\n ***********************************************/\n\n fn.getFieldNames = function (dataExtensionKey) {\n var de = DataExtension.Init(dataExtensionKey);\n var fields = de.Fields.Retrieve();\n\n fields.sort(function (a, b) { return (a.Ordinal > b.Ordinal) ? 1 : -1 });\n\n var out = [];\n\n for (k in fields) {\n out = out.concat(fields[k].Name);\n }\n\n return out;\n\n } //End retrieveFieldNames\n\n\n /***********************************************\n *\n * function formatResult()\n * Takes Objects that are Name/Value pairs {Name: \"Key\", Value: \"Value\"} and\n * normalizes them to a standard JSON object {key: \"value\"}\n *\n * @peram {arr} array to normalize\n * @peram {prop} property key of Array\n *\n * @output Array of normalized JSON object\n *\n ***********************************************/\n fn.formatResult = function (arr, prop) {\n var results = [];\n for (var i = 0; i < arr.length; i++) {\n var result_list = arr[i][prop];\n var obj = {};\n for (k in result_list) {\n var key = result_list[k].Name;\n var val = result_list[k].Value\n if (key.indexOf(\"_\") != 0) obj[key] = val;\n }\n results.push(obj);\n }\n return results;\n };\n\n\n fn.getSubscriberStatus = function (subscriberId, fns) {\n try {\n var subscriberStatusConfig = {\n soapObjName: 'Subscriber',\n cols: ['Status'],\n filter: {\n Property: 'ID',\n SimpleOperator: 'equals',\n Value: subscriberId\n }\n }\n\n var subscriber = fns.wsProxy.retrieve(subscriberStatusConfig)\n\n if(subscriber.Status === 'OK'){\n return subscriber.Results[0].Status\n }\n\n } catch (err) {\n return err\n }\n }\n\n\n fn.getAllSubscribersListID = function (fns) {\n try {\n var allsubsConfig = {\n soapObjName: 'List',\n cols: ['ID'],\n filter: {\n Property: 'ListName',\n SimpleOperator: 'equals',\n Value: 'All Subscribers'\n }\n }\n\n var allSubsReq = fns.wsProxy.retrieve(allsubsConfig)\n\n if (allSubsReq.Status === 'OK') {\n return allSubsReq.Results[0].ID\n }\n\n return 0\n\n } catch (err) {\n return err\n }\n }\n\n\n fn.toggleUnsubscribe = function (unsubEvent, currentStatus, fns) {\n try {\n if (unsubEvent.unsubscribe === true && currentStatus === 'Active') {\n var prox = new Script.Util.WSProxy();\n var props = [\n { Name: \"SubscriberKey\", Value: unsubEvent.subscriberKey },\n { Name: \"EmailAddress\", Value: unsubEvent.emailAddress },\n { Name: \"JobID\", Value: unsubEvent.jobId },\n { Name: \"ListID\", Value: unsubEvent.listId },\n { Name: \"BatchID\", Value: 0 }\n ];\n\n return prox.execute(props, \"LogUnsubEvent\");\n \n } else if(unsubEvent.unsubscribe === false && currentStatus !== 'Active'){\n var updateSubscriberStatusConfig = {\n soapObjName: 'Subscriber',\n options: {\n SaveOptions: [{\n PropertyName: \"*\",\n SaveAction: \"UpdateAdd\"\n }]\n },\n payload: {\n SubscriberKey: unsubEvent.subscriberKey,\n Status: 'Active',\n Lists: [{\n ID: unsubEvent.listId\n }]\n }\n }\n\n return fns.wsProxy.update(updateSubscriberStatusConfig)\n }\n\n } catch (err) {\n return err\n }\n }\n\n return fn\n }\n\n</script>"
},
{
"id": 111064,
"bldrId": "5bf59e5c-ea10-47c6-8eaa-8dd5eee58b68",
"name": "app_configuration",
"customerKey": "1318249a-f6c7-4c8f-93e9-e23e2c4d3064",
"assetType": {
"id": 220,
"name": "codesnippetblock",
"displayName": "Code Snippet Block"
},
"category": {
"id": 105683,
"name": "en-us",
"parentId": 105682,
"folderPath": "Content Builder/Basetime Preference Center/configurations/basetime/en-us"
},
"content": "{\n \"branding\": {\n \"brandName\": \"Basetime\",\n \"websiteURL\": \"https://basetime.io\",\n \"supportDarkMode\": \"true\",\n \"default\": {\n \"logo\": \"https://www.ikea.com/us/en/static/ikea-logo.f7d9229f806b59ec64cb.svg\",\n \"colors\": {\n \"primary\": \"#00FFFF\",\n \"secondary\": \"blue\",\n \"accent\": \"yellow\",\n \"paper\": \"#fff\"\n }\n },\n \"dark\": {\n \"logo\": \"https://basetime.io/basetime-developer-network-logo.svg\",\n \"colors\": {\n \"primary\": \"#aadeeb\",\n \"secondary\": \"#0098bc\",\n \"accent\": \"#fc6833\",\n \"paper\": \"#0f1d20\"\n }\n }\n },\n \"map\": {\n \"content_block\": {\n \"preference_options\": \"Content Builder\\\\Basetime Preference Center\\\\configurations\\\\preference_options\",\n \"branding_bar\": \"Content Builder\\\\Basetime Preference Center\\\\frontend\\\\components\\\\branding_bar\",\n \"channel_drawer\": \"Content Builder\\\\Basetime Preference Center\\\\frontend\\\\components\\\\channel_drawer\",\n \"preference_form\": \"Content Builder\\\\Basetime Preference Center\\\\frontend\\\\components\\\\preference_form\",\n \"unauthorized_user\": \"Content Builder\\\\Basetime Preference Center\\\\frontend\\\\components\\\\unauthorized_user\",\n \"legal\": \"Content Builder\\\\Basetime Preference Center\\\\frontend\\\\components\\\\legal\",\n \"submit_button_animation\": \"'Content Builder\\\\Basetime Preference Center\\\\frontend\\\\styles\\\\submit_button_animation\",\n \"app_js\": \"Content Builder\\\\Basetime Preference Center\\\\frontend\\\\app_js\",\n \"ssjs\": {\n \"wsProxy\": \"Content Builder\\\\Basetime Preference Center\\\\lib\\\\ssjs\\\\wsProxy\",\n \"utils\": \"Content Builder\\\\Basetime Preference Center\\\\lib\\\\ssjs\\\\utils\"\n }\n },\n \"data_extension\": {\n \"preferenceCenterExternalKey\": \"A89D62BA-3F5F-400C-B0E9-979FD11948EF\"\n }\n },\n \"apiBaseURL\": \"https://cloud.emailmarketingunderstood.com/basetimepreferenceapi\",\n \"action_toggles\": {\n \"unsubscribe\": false\n }\n}"
},
{
"id": 111065,
"bldrId": "ccae12fb-51b8-4675-95d8-0f922667887e",
"name": "preference_options",
"customerKey": "6d490228-8b62-4d62-b7fb-5f7846be2e1d",
"assetType": {
"id": 220,
"name": "codesnippetblock",
"displayName": "Code Snippet Block"
},
"category": {
"id": 105683,
"name": "en-us",
"parentId": 105682,
"folderPath": "Content Builder/Basetime Preference Center/configurations/basetime/en-us"
},
"content": "{\n \"profile\": {\n \"headline\": \"Update your profile\",\n \"copy\": \"\",\n \"inputs\": [\n {\n \"type\": \"text\",\n \"label\": \"First Name\",\n \"name\": \"firstName\" \n },\n {\n \"type\": \"text\",\n \"label\": \"Last Name\",\n \"name\": \"lastName\"\n }\n ]\n },\n \"channels\": {\n \"email\": {\n \"icon\": \"mdi-email\",\n \"preferences\": {\n \"headline\": \"Email Preferences\",\n \"copy\": \"Please select your email preferences below\",\n \"radios\": [\n {\n \"value\": \"onceAWeek\",\n \"label\": \"Once A Week\"\n },\n {\n \"value\": \"holidays\",\n \"label\": \"Holidays Only\"\n },\n {\n \"value\": \"specialEvents\",\n \"label\": \"Special Events Only\"\n },\n {\n \"value\": \"unsubscribe\",\n \"label\": \"Unsubscribe Me From All Emails\"\n }\n ]\n },\n \"subscriptions\": {\n \"headline\": \"Email Subscriptions\",\n \"copy\": \"Please select your email subscriptions below\",\n \"inputs\": [],\n \"checkboxes\": [\n {\n \"value\": \"dailyNewsletter\",\n \"label\": \"Daily Newsletter\"\n },\n {\n \"value\": \"devChat\",\n \"label\": \"Developer Chat\"\n },\n {\n \"value\": \"devOps\",\n \"label\": \"Developer Ops Weekly\"\n }\n ]\n }\n },\n \"sms\": {\n \"icon\": \"mdi-android-messages\",\n \"preferences\": {\n \"headline\": \"SMS Preferences\",\n \"copy\": \"Please select your text message preferences below\",\n \"radios\": [\n {\n \"value\": \"onceAWeek\",\n \"label\": \"Once A Week\"\n },\n {\n \"value\": \"holidays\",\n \"label\": \"Holidays Only\"\n },\n {\n \"value\": \"specialEvents\",\n \"label\": \"Special Events Only\"\n },\n {\n \"value\": \"unsubscribe\",\n \"label\": \"Unsubscribe Me From All Emails\"\n }\n ]\n },\n \"subscriptions\": {\n \"headline\": \"SMS Subscriptions\",\n \"copy\": \"Please select your text message subscriptions below\",\n \"inputs\": [],\n \"checkboxes\": [\n {\n \"value\": \"dailyNewsletter\",\n \"label\": \"Daily Newsletter\"\n },\n {\n \"value\": \"devChat\",\n \"label\": \"Developer Chat\"\n },\n {\n \"value\": \"devOps\",\n \"label\": \"Developer Ops Weekly\"\n }\n ]\n }\n }\n },\n \"unauthorized\": {\n \"icon\": \"mdi-account-question\",\n \"copy\": \"Looks like we can't find you in your system. <br> Please ensure you've reached this page from a basetime.io email. <br><br> Visit <a href='basetime.io'>Basetime.io</a> to sign up for emails.\"\n },\n \"legal\": {\n \"icon\": \"mdi-account-question\",\n \"copy\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\"\n }\n}\n"
},
{
"id": 111108,
"bldrId": "b04a04dc-89ed-41fd-b680-8af940be5902",
"name": "app_configuration",
"customerKey": "74a66077-043f-456f-8dd8-12a3ff0eaf8e",
"assetType": {
"id": 220,
"name": "codesnippetblock",
"displayName": "Code Snippet Block"
},
"category": {
"id": 105699,
"name": "es-us",
"parentId": 105682,
"folderPath": "Content Builder/Basetime Preference Center/configurations/basetime/es-us"
},
"content": "{\n \"branding\": {\n \"brandName\": \"Basetime\",\n \"websiteURL\": \"https://basetime.io\",\n \"supportDarkMode\": \"true\",\n \"default\": {\n \"logo\": \"https://www.ikea.com/us/en/static/ikea-logo.f7d9229f806b59ec64cb.svg\",\n \"colors\": {\n \"primary\": \"#00FFFF\",\n \"secondary\": \"blue\",\n \"accent\": \"yellow\",\n \"paper\": \"#fff\"\n }\n },\n \"dark\": {\n \"logo\": \"https://basetime.io/basetime-developer-network-logo.svg\",\n \"colors\": {\n \"primary\": \"#aadeeb\",\n \"secondary\": \"#0098bc\",\n \"accent\": \"#fc6833\",\n \"paper\": \"#0f1d20\"\n }\n }\n },\n \"map\": {\n \"content_block\": {\n \"preference_options\": \"Content Builder\\\\Basetime Preference Center\\\\configurations\\\\preference_options\",\n \"branding_bar\": \"Content Builder\\\\Basetime Preference Center\\\\frontend\\\\components\\\\branding_bar\",\n \"channel_drawer\": \"Content Builder\\\\Basetime Preference Center\\\\frontend\\\\components\\\\channel_drawer\",\n \"preference_form\": \"Content Builder\\\\Basetime Preference Center\\\\frontend\\\\components\\\\preference_form\",\n \"unauthorized_user\": \"Content Builder\\\\Basetime Preference Center\\\\frontend\\\\components\\\\unauthorized_user\",\n \"legal\": \"Content Builder\\\\Basetime Preference Center\\\\frontend\\\\components\\\\legal\",\n \"submit_button_animation\": \"'Content Builder\\\\Basetime Preference Center\\\\frontend\\\\styles\\\\submit_button_animation\",\n \"app_js\": \"Content Builder\\\\Basetime Preference Center\\\\frontend\\\\app_js\",\n \"ssjs\": {\n \"wsProxy\": \"Content Builder\\\\Basetime Preference Center\\\\lib\\\\ssjs\\\\wsProxy\",\n \"utils\": \"Content Builder\\\\Basetime Preference Center\\\\lib\\\\ssjs\\\\utils\"\n }\n },\n \"data_extension\": {\n \"preferenceCenterExternalKey\": \"A89D62BA-3F5F-400C-B0E9-979FD11948EF\"\n }\n },\n \"apiBaseURL\": \"https://cloud.emailmarketingunderstood.com/basetimepreferenceapi\",\n \"action_toggles\": {\n \"unsubscribe\": true\n }\n}"
},
{
"id": 111109,
"bldrId": "56532c14-0d3f-4a53-a2a0-f776b8f42195",
"name": "preference_options",
"customerKey": "d616a127-b223-45b0-8eb7-3baaff9f70cb",
"assetType": {
"id": 220,
"name": "codesnippetblock",
"displayName": "Code Snippet Block"
},
"category": {
"id": 105699,
"name": "es-us",
"parentId": 105682,
"folderPath": "Content Builder/Basetime Preference Center/configurations/basetime/es-us"
},
"content": "{\n \"profile\": {\n \"headline\": \"Actualiza tu perfil\",\n \"copy\": \"\",\n \"inputs\": [\n {\n \"type\": \"text\",\n \"label\": \"Primer nombre\",\n \"name\": \"firstName\" \n },\n {\n \"type\": \"text\",\n \"label\": \"Apellido\",\n \"name\": \"lastName\"\n }\n ]\n },\n \"channels\": {\n \"email\": {\n \"icon\": \"mdi-email\",\n \"preferences\": {\n \"headline\": \"Preferencias de correo electrónico\",\n \"copy\": \"Seleccione sus preferencias de correo electrónico a continuación\",\n \"radios\": [\n {\n \"value\": \"onceAWeek\",\n \"label\": \"Una vez por semana\"\n },\n {\n \"value\": \"holidays\",\n \"label\": \"Solo dias festivos\"\n },\n {\n \"value\": \"specialEvents\",\n \"label\": \"Solo eventos especiales\"\n },\n {\n \"value\": \"unsubscribe\",\n \"label\": \"Darme de baja de todos los correos electrónicos\"\n }\n ]\n },\n \"subscriptions\": {\n \"headline\": \"subscripcion de correo electronico\",\n \"copy\": \"Seleccione sus suscripciones de correo electrónico a continuación\",\n \"inputs\": [],\n \"checkboxes\": [\n {\n \"value\": \"dailyNewsletter\",\n \"label\": \"Boletín diario\"\n },\n {\n \"value\": \"devChat\",\n \"label\": \"Charla de desarrollador\"\n },\n {\n \"value\": \"devOps\",\n \"label\": \"Operaciones de desarrollador semanales\"\n }\n ]\n }\n }\n },\n \"unauthorized\": {\n \"icon\": \"mdi-account-question\",\n \"copy\": \"Parece que no podemos encontrarte en tu sistema. <br> Asegúrese de haber llegado a esta página desde un correo electrónico de basetime.io. <br><br> Visite <a href='basetime.io'>Basetime.io</a> para registrarse para recibir correos electrónicos.\"\n },\n \"legal\": {\n \"icon\": \"mdi-account-question\",\n \"copy\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\"\n }\n}\n"
},
{
"id": 106368,
"bldrId": "67c84378-f0f6-428c-9f22-8a21cda6dcf7",
"name": "index",
"customerKey": "a448dc4e-1fde-41ca-bb6b-216ebb375e44",
"assetType": {
"id": 205,
"name": "webpage",
"displayName": "Web Page"
},
"category": {
"id": 35088,
"name": "Content Builder",
"parentId": 0,
"folderPath": "Content Builder"
},
"meta": {
"globalStyles": {
"isLocked": false,
"body": {
"max-width": "1280px"
}
}
},
"views": {
"html": {
"thumbnail": {},
"content": "<!DOCTYPE html>\n<html>\n\n<head>\n\n <script src=\"https://cdn.jsdelivr.net/npm/vue@2.x/dist/vue.js\"></script>\n <script src=\"https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.js\"></script>\n\n <!-- Axios API - https://www.npmjs.com/package/axios -->\n <script src=\"https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js\"></script>\n\n <!-- Toast Notifications - https://www.npmjs.com/package/vue-toast-notification -->\n <script src=\"https://cdn.jsdelivr.net/npm/vue-toast-notification@0.6\"></script>\n <link href=\"https://cdn.jsdelivr.net/npm/vue-toast-notification@0.6/dist/theme-sugar.css\" rel=\"stylesheet\">\n\n \n <script src=\"https://cdn.jsdelivr.net/npm/@braid/vue-formulate@2.5.3/dist/formulate.min.js\"></script>\n <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/@braid/vue-formulate@2.5.3/dist/snow.css\">\n\n <link href=\"https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900\" rel=\"stylesheet\">\n <link href=\"https://cdn.jsdelivr.net/npm/@mdi/font@6.x/css/materialdesignicons.min.css\" rel=\"stylesheet\">\n <link href=\"https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.min.css\" rel=\"stylesheet\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui\">\n</head>\n\n<body>\n <div v-cloak id=\"app\">\n %%=TreatAsContent(ContentBlockByName('Content Builder\\Basetime Preference Center\\frontend\\app_html'))=%%\n </div>\n\n\n %%=TreatAsContent(ContentBlockByName('Content Builder\\Basetime Preference Center\\frontend\\components\\_component_imports'))=%%\n\n</body>\n\n</html>",
"meta": {},
"slots": {
"col1": {
"design": "<p style=\"font-family:arial;color:#ccc;font-size:11px;text-align:center;vertical-align:middle;font-weight:bold;padding:10px;margin:0;border:#ccc dashed 1px;\">Drop blocks or content here</p>",
"modelVersion": 2
}
},
"modelVersion": 2
}
}
},
{
"id": 106396,
"bldrId": "b73bf169-af9e-4e6c-8243-26d150979b14",
"name": "backend_api",
"customerKey": "1fcee7d2-3998-4d17-87e2-b487abf3bb65",
"assetType": {
"id": 240,
"name": "jscoderesource",
"displayName": "Javascript Code Resource"
},
"category": {
"id": 35088,
"name": "Content Builder",
"parentId": 0,
"folderPath": "Content Builder"
},
"content": "%%=TreatAsContent(ContentBlockByName('Content Builder\\Basetime Preference Center\\backend\\processing_api'))=%%"
},
{
"bldrId": "2ca8d070-29a5-4922-a2fb-165fa21f1b34",
"name": "legal",
"assetType": {
"id": 220,
"name": "codesnippetblock"
},
"category": {
"id": 103526,
"name": "components",
"parentId": 103525,
"folderPath": "Content Builder/Basetime Preference Center/frontend/components"
},
"content": "/*\nWhat is this component?\n*/\nVue.component('legal', {\nprops: {\nlegal: Object,\nbranding: Object\n},\nmounted() {\n\n},\ndata() {\nreturn {\n\n}\n},\nwatch: {\n\n},\nmethods: {\n\n},\ntemplate: `\n<v-row\n class=\"mt-5\"\n>\n <v-col cols=\"10\" class=\"flex text-center mx-auto\">\n <v-divider class=\"my-4\"></v-divider>\n <v-row justify=\"space-around\">\n <v-col cols=\"8\" class=\"text-caption\">\n <span v-html=\"legal.copy\"></span>\n </v-col>\n </v-row>\n\n </v-col>\n</v-row>\n`\n})",
"id": 111324,
"customerKey": "21987ffa-402b-4a8d-a184-2f6dd6d0e590"
}
]
}
}