@segment/action-destinations 3.262.0-staging-dbf2c12ff → 3.263.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/dist/destinations/customerio/utils.d.ts +1 -1
- package/dist/destinations/engage/utils/track.d.ts +17 -17
- package/dist/destinations/responsys/index.js +6 -2
- package/dist/destinations/responsys/index.js.map +1 -1
- package/dist/destinations/responsys/sendAudience/generated-types.d.ts +1 -1
- package/dist/destinations/responsys/sendAudience/index.js +14 -4
- package/dist/destinations/responsys/sendAudience/index.js.map +1 -1
- package/dist/destinations/responsys/sendCustomTraits/generated-types.d.ts +1 -1
- package/dist/destinations/responsys/sendCustomTraits/index.js +14 -4
- package/dist/destinations/responsys/sendCustomTraits/index.js.map +1 -1
- package/dist/destinations/responsys/utils.d.ts +2 -2
- package/dist/destinations/responsys/utils.js +21 -5
- package/dist/destinations/responsys/utils.js.map +1 -1
- package/package.json +3 -3
- package/dist/destinations/amazon-ads/utils.d.ts +0 -25
- package/dist/destinations/amazon-ads/utils.js +0 -8
- package/dist/destinations/amazon-ads/utils.js.map +0 -1
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/generated-types.d.ts +0 -36
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/generated-types.js +0 -3
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/generated-types.js.map +0 -1
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.d.ts +0 -5
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js +0 -452
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendSms/generated-types.d.ts +0 -22
- package/dist/destinations/engage-messaging-twilio/sendSms/generated-types.js +0 -3
- package/dist/destinations/engage-messaging-twilio/sendSms/generated-types.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendSms/index.d.ts +0 -5
- package/dist/destinations/engage-messaging-twilio/sendSms/index.js +0 -131
- package/dist/destinations/engage-messaging-twilio/sendSms/index.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.d.ts +0 -23
- package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.js +0 -131
- package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/generated-types.d.ts +0 -24
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/generated-types.js +0 -3
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/generated-types.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.d.ts +0 -5
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.js +0 -133
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.d.ts +0 -21
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js +0 -75
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/utils/message-sender.d.ts +0 -24
- package/dist/destinations/engage-messaging-twilio/utils/message-sender.js +0 -111
- package/dist/destinations/engage-messaging-twilio/utils/message-sender.js.map +0 -1
- package/dist/destinations/hubspot/helperFunctions.d.ts +0 -7
- package/dist/destinations/hubspot/helperFunctions.js +0 -27
- package/dist/destinations/hubspot/helperFunctions.js.map +0 -1
- package/dist/destinations/mixpanel/utils.d.ts +0 -13
- package/dist/destinations/mixpanel/utils.js +0 -117
- package/dist/destinations/mixpanel/utils.js.map +0 -1
- package/dist/destinations/snap-conversions-api/snap-capi-properties.d.ts +0 -30
- package/dist/destinations/snap-conversions-api/snap-capi-properties.js +0 -316
- package/dist/destinations/snap-conversions-api/snap-capi-properties.js.map +0 -1
- package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.d.ts +0 -3
- package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js +0 -34
- package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js.map +0 -1
- package/dist/destinations/vernst-test/generated-types.d.ts +0 -2
- package/dist/destinations/vernst-test/generated-types.js +0 -3
- package/dist/destinations/vernst-test/generated-types.js.map +0 -1
- package/dist/destinations/vernst-test/index.d.ts +0 -4
- package/dist/destinations/vernst-test/index.js +0 -20
- package/dist/destinations/vernst-test/index.js.map +0 -1
- package/dist/destinations/vernst-test/pingWebhook/generated-types.d.ts +0 -3
- package/dist/destinations/vernst-test/pingWebhook/generated-types.js +0 -3
- package/dist/destinations/vernst-test/pingWebhook/generated-types.js.map +0 -1
- package/dist/destinations/vernst-test/pingWebhook/index.d.ts +0 -5
- package/dist/destinations/vernst-test/pingWebhook/index.js +0 -21
- package/dist/destinations/vernst-test/pingWebhook/index.js.map +0 -1
|
@@ -1,452 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
7
|
-
const liquidjs_1 = require("liquidjs");
|
|
8
|
-
const cheerio_1 = __importDefault(require("cheerio"));
|
|
9
|
-
const escape_goat_1 = require("escape-goat");
|
|
10
|
-
const Liquid = new liquidjs_1.Liquid();
|
|
11
|
-
const insertEmailPreviewText = (html, previewText) => {
|
|
12
|
-
const $ = cheerio_1.default.load(html);
|
|
13
|
-
$('body').prepend(`
|
|
14
|
-
<div style='display: none; max-height: 0px; overflow: hidden;'>
|
|
15
|
-
${escape_goat_1.htmlEscape(previewText)}
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
<div style='display: none; max-height: 0px; overflow: hidden;'>
|
|
19
|
-
${' ‌'.repeat(13)}
|
|
20
|
-
</div>
|
|
21
|
-
`);
|
|
22
|
-
return $.html();
|
|
23
|
-
};
|
|
24
|
-
const getProfileApiEndpoint = (environment, region) => {
|
|
25
|
-
const domainName = region === 'eu-west-1' ? 'profiles.euw1.segment' : 'profiles.segment';
|
|
26
|
-
const topLevelName = environment === 'production' ? 'com' : 'build';
|
|
27
|
-
return `https://${domainName}.${topLevelName}`;
|
|
28
|
-
};
|
|
29
|
-
const fetchProfileTraits = async (request, settings, profileId, statsClient, tags, logger) => {
|
|
30
|
-
try {
|
|
31
|
-
const endpoint = getProfileApiEndpoint(settings.profileApiEnvironment, settings.region);
|
|
32
|
-
const response = await request(`${endpoint}/v1/spaces/${settings.spaceId}/collections/users/profiles/user_id:${profileId}/traits?limit=200`, {
|
|
33
|
-
headers: {
|
|
34
|
-
authorization: `Basic ${Buffer.from(settings.profileApiAccessToken + ':').toString('base64')}`,
|
|
35
|
-
'content-type': 'application/json'
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
tags.push(`profile_status_code:${response.status}`);
|
|
39
|
-
statsClient?.incr('actions-personas-messaging-sendgrid.profile_invoked', 1, tags);
|
|
40
|
-
const body = await response.json();
|
|
41
|
-
return body.traits;
|
|
42
|
-
}
|
|
43
|
-
catch (error) {
|
|
44
|
-
logger?.error(`TE Messaging: Email profile traits request failure - ${settings.spaceId} - [${error}]`);
|
|
45
|
-
tags.push('reason:profile_error');
|
|
46
|
-
statsClient?.incr('actions-personas-messaging-sendgrid.error', 1, tags);
|
|
47
|
-
throw new actions_core_1.IntegrationError('Unable to get profile traits for the email message', 'Email trait fetch failure', 500);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
const isRestrictedDomain = (email) => {
|
|
51
|
-
const restricted = ['gmailx.com', 'yahoox.com', 'aolx.com', 'hotmailx.com'];
|
|
52
|
-
const matches = /^.+@(.+)$/.exec(email.toLowerCase());
|
|
53
|
-
if (!matches) {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
const domain = matches[1];
|
|
57
|
-
return restricted.includes(domain);
|
|
58
|
-
};
|
|
59
|
-
const generateEmailHtml = async (request, settings, design, statsClient, tags, logger) => {
|
|
60
|
-
try {
|
|
61
|
-
statsClient?.incr('actions-personas-messaging-sendgrid.unlayer_request', 1, tags);
|
|
62
|
-
const response = await request('https://api.unlayer.com/v2/export/html', {
|
|
63
|
-
method: 'POST',
|
|
64
|
-
headers: {
|
|
65
|
-
authorization: `Basic ${Buffer.from(`${settings.unlayerApiKey}:`).toString('base64')}`,
|
|
66
|
-
'content-type': 'application/json'
|
|
67
|
-
},
|
|
68
|
-
body: JSON.stringify({
|
|
69
|
-
displayMode: 'email',
|
|
70
|
-
design: JSON.parse(design)
|
|
71
|
-
})
|
|
72
|
-
});
|
|
73
|
-
const body = await response.json();
|
|
74
|
-
return body.data.html;
|
|
75
|
-
}
|
|
76
|
-
catch (error) {
|
|
77
|
-
logger?.error(`TE Messaging: Email export request failure - ${settings.spaceId} - [${error}]`);
|
|
78
|
-
tags.push('reason:generate_email_html');
|
|
79
|
-
statsClient?.incr('actions-personas-messaging-sendgrid.error', 1, tags);
|
|
80
|
-
throw new actions_core_1.IntegrationError('Unable to export email as HTML', 'Export HTML failure', 400);
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
const parseTemplating = async (content, profile, contentType, statsClient, tags, settings, logger) => {
|
|
84
|
-
try {
|
|
85
|
-
const parsedContent = await Liquid.parseAndRender(content, { profile });
|
|
86
|
-
return parsedContent;
|
|
87
|
-
}
|
|
88
|
-
catch (error) {
|
|
89
|
-
logger?.error(`TE Messaging: Email templating parse failure - ${settings.spaceId} - [${error}]`);
|
|
90
|
-
tags.push('reason:parse_templating');
|
|
91
|
-
statsClient?.incr('actions-personas-messaging-sendgrid.error', 1, tags);
|
|
92
|
-
throw new actions_core_1.IntegrationError(`Unable to parse templating in email ${contentType}`, `${contentType} templating parse failure`, 400);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
const EXTERNAL_ID_KEY = 'email';
|
|
96
|
-
const action = {
|
|
97
|
-
title: 'Send Email',
|
|
98
|
-
description: 'Sends Email to a user powered by SendGrid',
|
|
99
|
-
defaultSubscription: 'type = "track" and event = "Audience Entered"',
|
|
100
|
-
fields: {
|
|
101
|
-
send: {
|
|
102
|
-
label: 'Send Message',
|
|
103
|
-
description: 'Whether or not the message should actually get sent.',
|
|
104
|
-
type: 'boolean',
|
|
105
|
-
required: false,
|
|
106
|
-
default: false
|
|
107
|
-
},
|
|
108
|
-
traitEnrichment: {
|
|
109
|
-
label: 'Trait Enrich',
|
|
110
|
-
description: 'Whether or not trait enrich from event (i.e without profile api call)',
|
|
111
|
-
type: 'boolean',
|
|
112
|
-
required: false,
|
|
113
|
-
default: true
|
|
114
|
-
},
|
|
115
|
-
userId: {
|
|
116
|
-
label: 'User ID',
|
|
117
|
-
description: 'User ID in Segment',
|
|
118
|
-
type: 'string',
|
|
119
|
-
required: false,
|
|
120
|
-
default: { '@path': '$.userId' }
|
|
121
|
-
},
|
|
122
|
-
toEmail: {
|
|
123
|
-
label: 'Test Email',
|
|
124
|
-
description: 'Email to send to when testing',
|
|
125
|
-
type: 'string'
|
|
126
|
-
},
|
|
127
|
-
fromDomain: {
|
|
128
|
-
label: 'From Domain',
|
|
129
|
-
description: 'Verified domain in Sendgrid',
|
|
130
|
-
type: 'string',
|
|
131
|
-
allowNull: true
|
|
132
|
-
},
|
|
133
|
-
fromEmail: {
|
|
134
|
-
label: 'From Email',
|
|
135
|
-
description: 'From Email',
|
|
136
|
-
type: 'string',
|
|
137
|
-
required: true
|
|
138
|
-
},
|
|
139
|
-
fromName: {
|
|
140
|
-
label: 'From Name',
|
|
141
|
-
description: 'From Name displayed to end user email',
|
|
142
|
-
type: 'string',
|
|
143
|
-
required: true
|
|
144
|
-
},
|
|
145
|
-
replyToEqualsFrom: {
|
|
146
|
-
label: 'Reply To Equals From',
|
|
147
|
-
description: 'Whether "reply to" settings are the same as "from"',
|
|
148
|
-
type: 'boolean'
|
|
149
|
-
},
|
|
150
|
-
replyToEmail: {
|
|
151
|
-
label: 'Reply To Email',
|
|
152
|
-
description: 'The Email used by user to Reply To',
|
|
153
|
-
type: 'string',
|
|
154
|
-
required: true
|
|
155
|
-
},
|
|
156
|
-
replyToName: {
|
|
157
|
-
label: 'Reply To Name',
|
|
158
|
-
description: 'The Name used by user to Reply To',
|
|
159
|
-
type: 'string',
|
|
160
|
-
required: true
|
|
161
|
-
},
|
|
162
|
-
bcc: {
|
|
163
|
-
label: 'BCC',
|
|
164
|
-
description: 'BCC list of emails',
|
|
165
|
-
type: 'string',
|
|
166
|
-
required: true
|
|
167
|
-
},
|
|
168
|
-
previewText: {
|
|
169
|
-
label: 'Preview Text',
|
|
170
|
-
description: 'Preview Text',
|
|
171
|
-
type: 'string'
|
|
172
|
-
},
|
|
173
|
-
subject: {
|
|
174
|
-
label: 'Subject',
|
|
175
|
-
description: 'Subject for the email to be sent',
|
|
176
|
-
type: 'string',
|
|
177
|
-
required: true
|
|
178
|
-
},
|
|
179
|
-
body: {
|
|
180
|
-
label: 'Body',
|
|
181
|
-
description: 'The message body',
|
|
182
|
-
type: 'text'
|
|
183
|
-
},
|
|
184
|
-
bodyUrl: {
|
|
185
|
-
label: 'Body URL',
|
|
186
|
-
description: 'URL to the message body',
|
|
187
|
-
type: 'text'
|
|
188
|
-
},
|
|
189
|
-
bodyType: {
|
|
190
|
-
label: 'Body Type',
|
|
191
|
-
description: 'The type of body which is used generally html | design',
|
|
192
|
-
type: 'string',
|
|
193
|
-
required: true
|
|
194
|
-
},
|
|
195
|
-
bodyHtml: {
|
|
196
|
-
label: 'Body Html',
|
|
197
|
-
description: 'The HTML content of the body',
|
|
198
|
-
type: 'string'
|
|
199
|
-
},
|
|
200
|
-
groupId: {
|
|
201
|
-
label: 'Group ID',
|
|
202
|
-
description: 'Subscription group ID',
|
|
203
|
-
type: 'string'
|
|
204
|
-
},
|
|
205
|
-
externalIds: {
|
|
206
|
-
label: 'External IDs',
|
|
207
|
-
description: 'An array of user profile identity information.',
|
|
208
|
-
type: 'object',
|
|
209
|
-
multiple: true,
|
|
210
|
-
properties: {
|
|
211
|
-
id: {
|
|
212
|
-
label: 'ID',
|
|
213
|
-
description: 'A unique identifier for the collection.',
|
|
214
|
-
type: 'string'
|
|
215
|
-
},
|
|
216
|
-
type: {
|
|
217
|
-
label: 'type',
|
|
218
|
-
description: 'The external ID contact type.',
|
|
219
|
-
type: 'string'
|
|
220
|
-
},
|
|
221
|
-
subscriptionStatus: {
|
|
222
|
-
label: 'ID',
|
|
223
|
-
description: 'The subscription status for the identity.',
|
|
224
|
-
type: 'string'
|
|
225
|
-
},
|
|
226
|
-
groups: {
|
|
227
|
-
label: 'Subscription Groups',
|
|
228
|
-
description: 'Subscription groups and their statuses for this id.',
|
|
229
|
-
type: 'object',
|
|
230
|
-
multiple: true,
|
|
231
|
-
properties: {
|
|
232
|
-
id: {
|
|
233
|
-
label: 'Subscription group id',
|
|
234
|
-
type: 'string'
|
|
235
|
-
},
|
|
236
|
-
isSubscribed: {
|
|
237
|
-
label: 'status',
|
|
238
|
-
description: 'Group subscription status true is subscribed, false is unsubscribed or did-not-subscribe',
|
|
239
|
-
type: 'boolean'
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
},
|
|
244
|
-
default: {
|
|
245
|
-
'@arrayPath': [
|
|
246
|
-
'$.external_ids',
|
|
247
|
-
{
|
|
248
|
-
id: {
|
|
249
|
-
'@path': '$.id'
|
|
250
|
-
},
|
|
251
|
-
type: {
|
|
252
|
-
'@path': '$.type'
|
|
253
|
-
},
|
|
254
|
-
subscriptionStatus: {
|
|
255
|
-
'@path': '$.isSubscribed'
|
|
256
|
-
},
|
|
257
|
-
groups: {
|
|
258
|
-
'@path': '$.groups'
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
]
|
|
262
|
-
}
|
|
263
|
-
},
|
|
264
|
-
customArgs: {
|
|
265
|
-
label: 'Custom Args',
|
|
266
|
-
description: 'Additional custom args that we be passed back opaquely on webhook events',
|
|
267
|
-
type: 'object',
|
|
268
|
-
required: false
|
|
269
|
-
},
|
|
270
|
-
traits: {
|
|
271
|
-
label: 'Traits',
|
|
272
|
-
description: "A user profile's traits",
|
|
273
|
-
type: 'object',
|
|
274
|
-
required: false,
|
|
275
|
-
default: { '@path': '$.properties' }
|
|
276
|
-
},
|
|
277
|
-
eventOccurredTS: {
|
|
278
|
-
label: 'Event Timestamp',
|
|
279
|
-
description: 'Time of when the actual event happened.',
|
|
280
|
-
type: 'string',
|
|
281
|
-
required: false,
|
|
282
|
-
default: {
|
|
283
|
-
'@path': '$.timestamp'
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
},
|
|
287
|
-
perform: async (request, { settings, payload, statsContext, logger }) => {
|
|
288
|
-
const statsClient = statsContext?.statsClient;
|
|
289
|
-
const tags = statsContext?.tags ?? [];
|
|
290
|
-
if (!settings.region) {
|
|
291
|
-
settings.region = 'us-west-2';
|
|
292
|
-
}
|
|
293
|
-
tags.push(`space_id:${settings.spaceId}`, `projectid:${settings.sourceId}`, `region:${settings.region}`);
|
|
294
|
-
if (!payload.send) {
|
|
295
|
-
logger?.info(`TE Messaging: Email send disabled - ${settings.spaceId}`);
|
|
296
|
-
statsClient?.incr('actions-personas-messaging-sendgrid.send-disabled', 1, tags);
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
const emailProfile = payload?.externalIds?.find((meta) => meta.type === 'email');
|
|
300
|
-
if (!emailProfile?.subscriptionStatus ||
|
|
301
|
-
['unsubscribed', 'did not subscribed', 'false'].includes(emailProfile.subscriptionStatus)) {
|
|
302
|
-
logger?.info(`TE Messaging: Email recipient not subscribed or external ids were omitted from request - ${settings.spaceId}`);
|
|
303
|
-
statsClient?.incr('actions-personas-messaging-sendgrid.notsubscribed', 1, tags);
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
|
-
else if (['subscribed', 'true'].includes(emailProfile?.subscriptionStatus)) {
|
|
307
|
-
statsClient?.incr('actions-personas-messaging-sendgrid.subscribed', 1, tags);
|
|
308
|
-
if (payload.groupId && payload.groupId.length !== 0) {
|
|
309
|
-
const group = (payload.externalIds ?? [])
|
|
310
|
-
.flatMap((externalId) => externalId.groups)
|
|
311
|
-
.find((group) => group?.id === payload.groupId);
|
|
312
|
-
if (!group) {
|
|
313
|
-
statsClient?.incr('actions-personas-messaging-sendgrid.group_notfound', 1, tags);
|
|
314
|
-
return;
|
|
315
|
-
}
|
|
316
|
-
else if (!group.isSubscribed) {
|
|
317
|
-
statsClient?.incr('actions-personas-messaging-sendgrid.group_notsubscribed', 1, tags);
|
|
318
|
-
return;
|
|
319
|
-
}
|
|
320
|
-
statsClient?.incr('actions-personas-messaging-sendgrid.group_subscribed', 1, tags);
|
|
321
|
-
}
|
|
322
|
-
let traits;
|
|
323
|
-
if (payload.traitEnrichment) {
|
|
324
|
-
traits = payload?.traits ? payload?.traits : JSON.parse('{}');
|
|
325
|
-
}
|
|
326
|
-
else {
|
|
327
|
-
if (!payload.userId) {
|
|
328
|
-
logger?.error(`TE Messaging: Unable to process email, no userId provided and trait enrichment disabled - ${settings.spaceId}`);
|
|
329
|
-
tags.push('reason:missing_user_id');
|
|
330
|
-
statsClient?.incr('actions-personas-messaging-sendgrid.error', 1, tags);
|
|
331
|
-
throw new actions_core_1.IntegrationError('Unable to process email, no userId provided and trait enrichment disabled', 'Invalid parameters', 400);
|
|
332
|
-
}
|
|
333
|
-
traits = await fetchProfileTraits(request, settings, payload.userId, statsClient, tags, logger);
|
|
334
|
-
}
|
|
335
|
-
const profile = {
|
|
336
|
-
email: emailProfile.id,
|
|
337
|
-
traits
|
|
338
|
-
};
|
|
339
|
-
const toEmail = payload.toEmail || profile.email;
|
|
340
|
-
if (!toEmail) {
|
|
341
|
-
return;
|
|
342
|
-
}
|
|
343
|
-
if (isRestrictedDomain(toEmail)) {
|
|
344
|
-
logger?.error(`TE Messaging: Emails with gmailx.com, yahoox.com, aolx.com, and hotmailx.com domains are blocked - ${settings.spaceId}`);
|
|
345
|
-
tags.push('reason:restricted_domain');
|
|
346
|
-
statsClient?.incr('actions-personas-messaging-sendgrid.error', 1, tags);
|
|
347
|
-
throw new actions_core_1.IntegrationError('Emails with gmailx.com, yahoox.com, aolx.com, and hotmailx.com domains are blocked.', 'Invalid input', 400);
|
|
348
|
-
}
|
|
349
|
-
let name;
|
|
350
|
-
if (traits.first_name && traits.last_name) {
|
|
351
|
-
name = `${traits.first_name} ${traits.last_name}`;
|
|
352
|
-
}
|
|
353
|
-
else if (traits.firstName && traits.lastName) {
|
|
354
|
-
name = `${traits.firstName} ${traits.lastName}`;
|
|
355
|
-
}
|
|
356
|
-
else if (traits.name) {
|
|
357
|
-
name = traits.name;
|
|
358
|
-
}
|
|
359
|
-
else {
|
|
360
|
-
name = traits.first_name || traits.last_name || traits.firstName || traits.lastName || 'User';
|
|
361
|
-
}
|
|
362
|
-
const bcc = JSON.parse(payload.bcc ?? '[]');
|
|
363
|
-
const parsedSubject = await parseTemplating(payload.subject, profile, 'Subject', statsClient, tags, settings, logger);
|
|
364
|
-
let parsedBodyHtml;
|
|
365
|
-
if (payload.bodyUrl && settings.unlayerApiKey) {
|
|
366
|
-
const { content: body } = await request(payload.bodyUrl, { method: 'GET', skipResponseCloning: true });
|
|
367
|
-
const bodyHtml = payload.bodyType === 'html'
|
|
368
|
-
? body
|
|
369
|
-
: await generateEmailHtml(request, settings, body, statsClient, tags, logger);
|
|
370
|
-
parsedBodyHtml = await parseTemplating(bodyHtml, profile, 'Body', statsClient, tags, settings, logger);
|
|
371
|
-
}
|
|
372
|
-
else {
|
|
373
|
-
parsedBodyHtml = await parseTemplating(payload.bodyHtml ?? '', profile, 'Body HTML', statsClient, tags, settings, logger);
|
|
374
|
-
}
|
|
375
|
-
if (payload.bodyType === 'design' && payload.previewText) {
|
|
376
|
-
const parsedPreviewText = await parseTemplating(payload.previewText, profile, 'Preview text', statsClient, tags, settings, logger);
|
|
377
|
-
parsedBodyHtml = insertEmailPreviewText(parsedBodyHtml, parsedPreviewText);
|
|
378
|
-
}
|
|
379
|
-
try {
|
|
380
|
-
statsClient?.incr('actions-personas-messaging-sendgrid.request', 1, tags);
|
|
381
|
-
const req = {
|
|
382
|
-
method: 'post',
|
|
383
|
-
headers: {
|
|
384
|
-
authorization: `Bearer ${settings.sendGridApiKey}`
|
|
385
|
-
},
|
|
386
|
-
json: {
|
|
387
|
-
personalizations: [
|
|
388
|
-
{
|
|
389
|
-
to: [
|
|
390
|
-
{
|
|
391
|
-
email: toEmail,
|
|
392
|
-
name: name
|
|
393
|
-
}
|
|
394
|
-
],
|
|
395
|
-
bcc: bcc.length > 0 ? bcc : undefined,
|
|
396
|
-
custom_args: {
|
|
397
|
-
...payload.customArgs,
|
|
398
|
-
source_id: settings.sourceId,
|
|
399
|
-
space_id: settings.spaceId,
|
|
400
|
-
user_id: payload.userId ?? undefined,
|
|
401
|
-
__segment_internal_external_id_key__: EXTERNAL_ID_KEY,
|
|
402
|
-
__segment_internal_external_id_value__: profile[EXTERNAL_ID_KEY]
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
],
|
|
406
|
-
from: {
|
|
407
|
-
email: payload.fromEmail,
|
|
408
|
-
name: payload.fromName
|
|
409
|
-
},
|
|
410
|
-
reply_to: {
|
|
411
|
-
email: payload.replyToEmail,
|
|
412
|
-
name: payload.replyToName
|
|
413
|
-
},
|
|
414
|
-
subject: parsedSubject,
|
|
415
|
-
content: [
|
|
416
|
-
{
|
|
417
|
-
type: 'text/html',
|
|
418
|
-
value: parsedBodyHtml
|
|
419
|
-
}
|
|
420
|
-
],
|
|
421
|
-
tracking_settings: {
|
|
422
|
-
subscription_tracking: {
|
|
423
|
-
enable: true,
|
|
424
|
-
substitution_tag: '[unsubscribe]'
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
};
|
|
429
|
-
statsClient?.set('actions-personas-messaging-sendgrid.request_body_size', JSON.stringify(req).length, tags);
|
|
430
|
-
const response = await request('https://api.sendgrid.com/v3/mail/send', req);
|
|
431
|
-
tags.push(`sendgrid_status_code:${response.status}`);
|
|
432
|
-
statsClient?.incr('actions-personas-messaging-sendgrid.response', 1, tags);
|
|
433
|
-
if (payload?.eventOccurredTS != undefined) {
|
|
434
|
-
statsClient?.histogram('actions-personas-messaging-sendgrid.eventDeliveryTS', Date.now() - new Date(payload?.eventOccurredTS).getTime(), tags);
|
|
435
|
-
}
|
|
436
|
-
return response;
|
|
437
|
-
}
|
|
438
|
-
catch (error) {
|
|
439
|
-
logger?.error(`TE Messaging: Email message request failure - ${settings.spaceId} - [${error}]`);
|
|
440
|
-
statsClient?.incr('actions-personas-messaging-sendgrid.request-failure', 1, tags);
|
|
441
|
-
throw new actions_core_1.IntegrationError('Unable to send email message', 'SendGrid API request failure', 500);
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
else {
|
|
445
|
-
logger?.error(`TE Messaging: Email subscription status invalid "${emailProfile.subscriptionStatus}" - ${settings.spaceId}`);
|
|
446
|
-
statsClient?.incr('actions-personas-messaging-sendgrid.sendgrid-error', 1, tags);
|
|
447
|
-
throw new actions_core_1.IntegrationError(`Failed to process the subscription state: "${emailProfile.subscriptionStatus}"`, 'Invalid subscriptionStatus value', 400);
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
};
|
|
451
|
-
exports.default = action;
|
|
452
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-sendgrid/sendEmail/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA0F;AAG1F,uCAA6C;AAC7C,sDAA6B;AAC7B,6CAAwC;AAExC,MAAM,MAAM,GAAG,IAAI,iBAAQ,EAAE,CAAA;AAI7B,MAAM,sBAAsB,GAAG,CAAC,IAAY,EAAE,WAAmB,EAAU,EAAE;IAC3E,MAAM,CAAC,GAAG,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAG5B,CAAC,CAAC,MAAM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BAAkB,GAAG,EAChF,kCAAkC,EAClC,GAAG,CACJ,CAAA;SACF;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export interface Payload {
|
|
2
|
-
userId?: string;
|
|
3
|
-
toNumber?: string;
|
|
4
|
-
from: string;
|
|
5
|
-
body?: string;
|
|
6
|
-
contentSid?: string;
|
|
7
|
-
customArgs?: {
|
|
8
|
-
[k: string]: unknown;
|
|
9
|
-
};
|
|
10
|
-
connectionOverrides?: string;
|
|
11
|
-
send?: boolean;
|
|
12
|
-
traitEnrichment?: boolean;
|
|
13
|
-
externalIds?: {
|
|
14
|
-
id?: string;
|
|
15
|
-
type?: string;
|
|
16
|
-
subscriptionStatus?: string;
|
|
17
|
-
}[];
|
|
18
|
-
traits?: {
|
|
19
|
-
[k: string]: unknown;
|
|
20
|
-
};
|
|
21
|
-
eventOccurredTS?: string;
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-twilio/sendSms/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const sms_sender_1 = require("./sms-sender");
|
|
4
|
-
const action = {
|
|
5
|
-
title: 'Send SMS',
|
|
6
|
-
description: 'Send SMS using Twilio',
|
|
7
|
-
defaultSubscription: 'type = "track" and event = "Audience Entered"',
|
|
8
|
-
fields: {
|
|
9
|
-
userId: {
|
|
10
|
-
label: 'User ID',
|
|
11
|
-
description: 'User ID in Segment',
|
|
12
|
-
type: 'string',
|
|
13
|
-
default: { '@path': '$.userId' }
|
|
14
|
-
},
|
|
15
|
-
toNumber: {
|
|
16
|
-
label: 'Test Number',
|
|
17
|
-
description: 'Number to send SMS to when testing',
|
|
18
|
-
type: 'string'
|
|
19
|
-
},
|
|
20
|
-
from: {
|
|
21
|
-
label: 'From',
|
|
22
|
-
description: 'The Twilio Phone Number, Short Code, or Messaging Service to send SMS from.',
|
|
23
|
-
type: 'string',
|
|
24
|
-
required: true
|
|
25
|
-
},
|
|
26
|
-
body: {
|
|
27
|
-
label: 'Message',
|
|
28
|
-
description: 'Message to send',
|
|
29
|
-
type: 'text',
|
|
30
|
-
required: false
|
|
31
|
-
},
|
|
32
|
-
contentSid: {
|
|
33
|
-
label: 'SMS content template SID',
|
|
34
|
-
description: 'Content template SID for Twilio Content API',
|
|
35
|
-
type: 'string',
|
|
36
|
-
required: false
|
|
37
|
-
},
|
|
38
|
-
customArgs: {
|
|
39
|
-
label: 'Custom Arguments',
|
|
40
|
-
description: 'Additional custom arguments that will be opaquely sent back on webhook events',
|
|
41
|
-
type: 'object',
|
|
42
|
-
required: false
|
|
43
|
-
},
|
|
44
|
-
connectionOverrides: {
|
|
45
|
-
label: 'Connection Overrides',
|
|
46
|
-
description: 'Connection overrides are configuration supported by twilio webhook services. Must be passed as fragments on the callback url',
|
|
47
|
-
type: 'string',
|
|
48
|
-
required: false
|
|
49
|
-
},
|
|
50
|
-
send: {
|
|
51
|
-
label: 'Send Message',
|
|
52
|
-
description: 'Whether or not the message should actually get sent.',
|
|
53
|
-
type: 'boolean',
|
|
54
|
-
required: false,
|
|
55
|
-
default: false
|
|
56
|
-
},
|
|
57
|
-
traitEnrichment: {
|
|
58
|
-
label: 'Trait Enrich',
|
|
59
|
-
description: 'Whether or not trait enrich from event (i.e without profile api call)',
|
|
60
|
-
type: 'boolean',
|
|
61
|
-
required: false,
|
|
62
|
-
default: true
|
|
63
|
-
},
|
|
64
|
-
externalIds: {
|
|
65
|
-
label: 'External IDs',
|
|
66
|
-
description: 'An array of user profile identity information.',
|
|
67
|
-
type: 'object',
|
|
68
|
-
multiple: true,
|
|
69
|
-
properties: {
|
|
70
|
-
id: {
|
|
71
|
-
label: 'ID',
|
|
72
|
-
description: 'A unique identifier for the collection.',
|
|
73
|
-
type: 'string'
|
|
74
|
-
},
|
|
75
|
-
type: {
|
|
76
|
-
label: 'type',
|
|
77
|
-
description: 'The external ID contact type.',
|
|
78
|
-
type: 'string'
|
|
79
|
-
},
|
|
80
|
-
subscriptionStatus: {
|
|
81
|
-
label: 'ID',
|
|
82
|
-
description: 'The subscription status for the identity.',
|
|
83
|
-
type: 'string'
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
default: {
|
|
87
|
-
'@arrayPath': [
|
|
88
|
-
'$.external_ids',
|
|
89
|
-
{
|
|
90
|
-
id: {
|
|
91
|
-
'@path': '$.id'
|
|
92
|
-
},
|
|
93
|
-
type: {
|
|
94
|
-
'@path': '$.type'
|
|
95
|
-
},
|
|
96
|
-
subscriptionStatus: {
|
|
97
|
-
'@path': '$.isSubscribed'
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
]
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
traits: {
|
|
104
|
-
label: 'Traits',
|
|
105
|
-
description: "A user profile's traits",
|
|
106
|
-
type: 'object',
|
|
107
|
-
required: false,
|
|
108
|
-
default: { '@path': '$.properties' }
|
|
109
|
-
},
|
|
110
|
-
eventOccurredTS: {
|
|
111
|
-
label: 'Event Timestamp',
|
|
112
|
-
description: 'Time of when the actual event happened.',
|
|
113
|
-
type: 'string',
|
|
114
|
-
required: false,
|
|
115
|
-
default: {
|
|
116
|
-
'@path': '$.timestamp'
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
perform: async (request, { settings, payload, statsContext, logger }) => {
|
|
121
|
-
const statsClient = statsContext?.statsClient;
|
|
122
|
-
const tags = statsContext?.tags || [];
|
|
123
|
-
if (!settings.region) {
|
|
124
|
-
settings.region = 'us-west-1';
|
|
125
|
-
}
|
|
126
|
-
tags.push(`space_id:${settings.spaceId}`, `projectid:${settings.sourceId}`, `region:${settings.region}`);
|
|
127
|
-
return new sms_sender_1.SmsMessageSender(request, payload, settings, statsClient, tags, logger).send();
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
exports.default = action;
|
|
131
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-twilio/sendSms/index.ts"],"names":[],"mappings":";;AAIA,6CAA+C;AAE/C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,uBAAuB;IACpC,mBAAmB,EAAE,+CAA+C;IACpE,MAAM,EAAE;QACN,MAAM,EAAE;YACN,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,oBAAoB;YACjC,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,oCAAoC;YACjD,IAAI,EAAE,QAAQ;SACf;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM;YACb,WAAW,EAAE,6EAA6E;YAC1F,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,iBAAiB;YAC9B,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,KAAK;SAChB;QACD,UAAU,EAAE;YACV,KAAK,EAAE,0BAA0B;YACjC,WAAW,EAAE,6CAA6C;YAC1D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;QACD,UAAU,EAAE;YACV,KAAK,EAAE,kBAAkB;YACzB,WAAW,EAAE,+EAA+E;YAC5F,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;QACD,mBAAmB,EAAE;YACnB,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EACT,8HAA8H;YAChI,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;QACD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