@activepieces/piece-reachinbox 0.0.1
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/README.md +7 -0
- package/package.json +35 -0
- package/src/index.d.ts +5 -0
- package/src/index.js +86 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/add-blocklist.d.ts +5 -0
- package/src/lib/actions/add-blocklist.js +74 -0
- package/src/lib/actions/add-blocklist.js.map +1 -0
- package/src/lib/actions/add-email.d.ts +4 -0
- package/src/lib/actions/add-email.js +80 -0
- package/src/lib/actions/add-email.js.map +1 -0
- package/src/lib/actions/add-leads.d.ts +7 -0
- package/src/lib/actions/add-leads.js +114 -0
- package/src/lib/actions/add-leads.js.map +1 -0
- package/src/lib/actions/enable-warmup.d.ts +3 -0
- package/src/lib/actions/enable-warmup.js +80 -0
- package/src/lib/actions/enable-warmup.js.map +1 -0
- package/src/lib/actions/get-campaign-analytics.d.ts +5 -0
- package/src/lib/actions/get-campaign-analytics.js +81 -0
- package/src/lib/actions/get-campaign-analytics.js.map +1 -0
- package/src/lib/actions/get-summary.d.ts +4 -0
- package/src/lib/actions/get-summary.js +64 -0
- package/src/lib/actions/get-summary.js.map +1 -0
- package/src/lib/actions/pause-campaign.d.ts +3 -0
- package/src/lib/actions/pause-campaign.js +75 -0
- package/src/lib/actions/pause-campaign.js.map +1 -0
- package/src/lib/actions/pause-warmup.d.ts +3 -0
- package/src/lib/actions/pause-warmup.js +80 -0
- package/src/lib/actions/pause-warmup.js.map +1 -0
- package/src/lib/actions/remove-email.d.ts +3 -0
- package/src/lib/actions/remove-email.js +77 -0
- package/src/lib/actions/remove-email.js.map +1 -0
- package/src/lib/actions/set-schedule.d.ts +16 -0
- package/src/lib/actions/set-schedule.js +158 -0
- package/src/lib/actions/set-schedule.js.map +1 -0
- package/src/lib/actions/start-campaign.d.ts +3 -0
- package/src/lib/actions/start-campaign.js +67 -0
- package/src/lib/actions/start-campaign.js.map +1 -0
- package/src/lib/actions/update-lead.d.ts +8 -0
- package/src/lib/actions/update-lead.js +144 -0
- package/src/lib/actions/update-lead.js.map +1 -0
- package/src/lib/common/index.d.ts +49 -0
- package/src/lib/common/index.js +48 -0
- package/src/lib/common/index.js.map +1 -0
- package/src/lib/triggers/campaign-completed.d.ts +8 -0
- package/src/lib/triggers/campaign-completed.js +71 -0
- package/src/lib/triggers/campaign-completed.js.map +1 -0
- package/src/lib/triggers/email-bounced.d.ts +8 -0
- package/src/lib/triggers/email-bounced.js +72 -0
- package/src/lib/triggers/email-bounced.js.map +1 -0
- package/src/lib/triggers/email-opened.d.ts +8 -0
- package/src/lib/triggers/email-opened.js +71 -0
- package/src/lib/triggers/email-opened.js.map +1 -0
- package/src/lib/triggers/email-sent.d.ts +8 -0
- package/src/lib/triggers/email-sent.js +74 -0
- package/src/lib/triggers/email-sent.js.map +1 -0
- package/src/lib/triggers/lead-interested.d.ts +8 -0
- package/src/lib/triggers/lead-interested.js +75 -0
- package/src/lib/triggers/lead-interested.js.map +1 -0
- package/src/lib/triggers/lead-not-interested.d.ts +8 -0
- package/src/lib/triggers/lead-not-interested.js +72 -0
- package/src/lib/triggers/lead-not-interested.js.map +1 -0
- package/src/lib/triggers/reply-received.d.ts +8 -0
- package/src/lib/triggers/reply-received.js +72 -0
- package/src/lib/triggers/reply-received.js.map +1 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateLead = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const index_1 = require("../common/index");
|
|
7
|
+
const __1 = require("../..");
|
|
8
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
+
// Define the updateLead action
|
|
10
|
+
exports.updateLead = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: __1.ReachinboxAuth,
|
|
12
|
+
name: 'updateLead',
|
|
13
|
+
displayName: 'Update Lead',
|
|
14
|
+
description: 'Updates a Lead.',
|
|
15
|
+
props: {
|
|
16
|
+
campaignId: pieces_framework_1.Property.Dropdown({
|
|
17
|
+
displayName: 'Select Campaign',
|
|
18
|
+
description: 'Choose a campaign from the list or enter the campaign ID manually.',
|
|
19
|
+
required: true,
|
|
20
|
+
refreshers: ['auth'],
|
|
21
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
22
|
+
const campaigns = yield (0, index_1.fetchCampaigns)(auth);
|
|
23
|
+
return {
|
|
24
|
+
options: campaigns.map((campaign) => ({
|
|
25
|
+
label: campaign.name,
|
|
26
|
+
value: campaign.id,
|
|
27
|
+
})),
|
|
28
|
+
disabled: campaigns.length === 0,
|
|
29
|
+
};
|
|
30
|
+
}),
|
|
31
|
+
}),
|
|
32
|
+
leadId: pieces_framework_1.Property.Dropdown({
|
|
33
|
+
displayName: 'Select Lead',
|
|
34
|
+
description: 'Choose a lead from the selected campaign.',
|
|
35
|
+
required: true,
|
|
36
|
+
refreshers: ['campaignId'],
|
|
37
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, campaignId }) {
|
|
38
|
+
if (!campaignId) {
|
|
39
|
+
return { options: [], disabled: true };
|
|
40
|
+
}
|
|
41
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
42
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
43
|
+
url: `${index_1.reachinboxCommon.baseUrl}leads?campaignId=${campaignId}&lastLead=false`,
|
|
44
|
+
headers: {
|
|
45
|
+
Authorization: `Bearer ${auth}`,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
if (response.status !== 200) {
|
|
49
|
+
throw new Error('Failed to fetch leads.');
|
|
50
|
+
}
|
|
51
|
+
const leads = Array.isArray(response.body.data.leads)
|
|
52
|
+
? response.body.data.leads
|
|
53
|
+
: [];
|
|
54
|
+
return {
|
|
55
|
+
options: leads.map((lead) => ({
|
|
56
|
+
label: lead.email,
|
|
57
|
+
value: lead.id,
|
|
58
|
+
})),
|
|
59
|
+
disabled: leads.length === 0,
|
|
60
|
+
};
|
|
61
|
+
}),
|
|
62
|
+
}),
|
|
63
|
+
email: pieces_framework_1.Property.ShortText({
|
|
64
|
+
displayName: 'Email',
|
|
65
|
+
description: 'Enter the new email address for the lead.',
|
|
66
|
+
required: true,
|
|
67
|
+
}),
|
|
68
|
+
firstName: pieces_framework_1.Property.ShortText({
|
|
69
|
+
displayName: 'First Name',
|
|
70
|
+
description: 'Enter the new first name for the lead.',
|
|
71
|
+
required: false,
|
|
72
|
+
}),
|
|
73
|
+
lastName: pieces_framework_1.Property.ShortText({
|
|
74
|
+
displayName: 'Last Name',
|
|
75
|
+
description: 'Enter the new last name for the lead.',
|
|
76
|
+
required: false,
|
|
77
|
+
}),
|
|
78
|
+
customVariables: pieces_framework_1.Property.Array({
|
|
79
|
+
displayName: 'Custom Variables',
|
|
80
|
+
description: 'Add custom variables as key-value pairs for the lead.',
|
|
81
|
+
properties: {
|
|
82
|
+
key: pieces_framework_1.Property.ShortText({
|
|
83
|
+
displayName: 'Key',
|
|
84
|
+
description: 'Enter the key for the custom variable',
|
|
85
|
+
required: true,
|
|
86
|
+
}),
|
|
87
|
+
value: pieces_framework_1.Property.ShortText({
|
|
88
|
+
displayName: 'Value',
|
|
89
|
+
description: 'Enter the value for the custom variable',
|
|
90
|
+
required: true,
|
|
91
|
+
}),
|
|
92
|
+
},
|
|
93
|
+
required: false,
|
|
94
|
+
defaultValue: [],
|
|
95
|
+
}),
|
|
96
|
+
},
|
|
97
|
+
run(context) {
|
|
98
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
const { campaignId, leadId, email, firstName, lastName, customVariables } = context.propsValue;
|
|
100
|
+
if (!campaignId || !leadId) {
|
|
101
|
+
throw new Error('Campaign ID and Lead ID are required.');
|
|
102
|
+
}
|
|
103
|
+
// Safely cast customVariables to CustomVariable[], default to an empty array if undefined
|
|
104
|
+
const customVariablesArray = (customVariables ||
|
|
105
|
+
[]);
|
|
106
|
+
// Process the custom variables into a key-value object for the lead attributes
|
|
107
|
+
const customVariablesObject = {};
|
|
108
|
+
customVariablesArray.forEach((variable) => {
|
|
109
|
+
customVariablesObject[variable.key] = variable.value;
|
|
110
|
+
});
|
|
111
|
+
// Include the custom variables in the lead update request
|
|
112
|
+
const url = `${index_1.reachinboxCommon.baseUrl}leads/update`;
|
|
113
|
+
try {
|
|
114
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
115
|
+
method: pieces_common_1.HttpMethod.PUT,
|
|
116
|
+
url: url,
|
|
117
|
+
headers: {
|
|
118
|
+
Authorization: `Bearer ${context.auth}`,
|
|
119
|
+
'Content-Type': 'application/json',
|
|
120
|
+
},
|
|
121
|
+
body: {
|
|
122
|
+
campaignId: campaignId,
|
|
123
|
+
leadId: leadId,
|
|
124
|
+
email: email,
|
|
125
|
+
attributes: Object.assign({ firstName: firstName || '', lastName: lastName || '' }, customVariablesObject),
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
if (response.status === 200) {
|
|
129
|
+
return {
|
|
130
|
+
success: true,
|
|
131
|
+
message: response.body.message || 'Lead updated successfully.',
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
throw new Error(`Failed to update lead: ${response.body.message}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
throw new Error(`Failed to update lead: ${error.message}`);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
//# sourceMappingURL=update-lead.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-lead.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/reachinbox/src/lib/actions/update-lead.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,2CAAmE;AACnE,6BAAuC;AAC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AAI,EAAE;wBACJ,UAAU,EAAE,UAAU;wBACtB,MAAM,EAAE,MAAM;wBACd,KAAK,EAAE,KAAK;wBACZ,UAAU,kBACR,SAAS,EAAE,SAAS,IAAI,EAAE,EAC1B,QAAQ,EAAE,QAAQ,IAAI,EAAE,IACrB,qBAAqB,CACzB;qBACF;iBACF,CAAC,CAAC;gBAEH,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBAC5B,OAAO;wBACL,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,IAAI,4BAA4B;qBAC/D,CAAC;gBACJ,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,KAAK,CAAC,0BAA0B,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;gBACrE,CAAC;YACH,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,MAAM,IAAI,KAAK,CAAC,0BAA0B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YAC7D,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export declare const reachinboxCommon: {
|
|
2
|
+
baseUrl: string;
|
|
3
|
+
};
|
|
4
|
+
export interface Campaign {
|
|
5
|
+
id: number;
|
|
6
|
+
name: string;
|
|
7
|
+
coreVariables: string[];
|
|
8
|
+
dailyLimit: number;
|
|
9
|
+
mailsSentToday: number;
|
|
10
|
+
accountsToUse: string[];
|
|
11
|
+
tracking: boolean;
|
|
12
|
+
linkTracking: boolean;
|
|
13
|
+
isActive: boolean;
|
|
14
|
+
hasStarted: boolean;
|
|
15
|
+
lastEmailUsed: number;
|
|
16
|
+
delay: number;
|
|
17
|
+
randomDelay: number;
|
|
18
|
+
stopOnReply: boolean;
|
|
19
|
+
createdAt: string;
|
|
20
|
+
updatedAt: string;
|
|
21
|
+
deletedAt: string | null;
|
|
22
|
+
sent: number;
|
|
23
|
+
totalOpens: string | null;
|
|
24
|
+
totalUniqueOpen: string;
|
|
25
|
+
totalReplies: string;
|
|
26
|
+
emails: {
|
|
27
|
+
sent: number;
|
|
28
|
+
totalOpens: number;
|
|
29
|
+
totalReplies: number;
|
|
30
|
+
};
|
|
31
|
+
status: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const fetchCampaigns: (auth: string) => Promise<Campaign[]>;
|
|
34
|
+
export interface AddLeadsRequestBody {
|
|
35
|
+
campaignId: string;
|
|
36
|
+
leads: {
|
|
37
|
+
email: string;
|
|
38
|
+
firstName: string;
|
|
39
|
+
lastName?: string;
|
|
40
|
+
}[];
|
|
41
|
+
newCoreVariables: string[];
|
|
42
|
+
duplicates: any[];
|
|
43
|
+
}
|
|
44
|
+
export interface AddLeadsResponse {
|
|
45
|
+
success: boolean;
|
|
46
|
+
message: string;
|
|
47
|
+
leadCount: number;
|
|
48
|
+
}
|
|
49
|
+
export declare const addLeadsToCampaign: (auth: string, body: AddLeadsRequestBody) => Promise<AddLeadsResponse>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addLeadsToCampaign = exports.fetchCampaigns = exports.reachinboxCommon = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
exports.reachinboxCommon = {
|
|
6
|
+
baseUrl: 'https://api.reachinbox.ai/api/v1/',
|
|
7
|
+
};
|
|
8
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
+
// Fetch campaigns from the ReachInbox API
|
|
10
|
+
const fetchCampaigns = (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
try {
|
|
13
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
14
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
15
|
+
url: 'https://api.reachinbox.ai/api/v1/campaigns/all?sort=newest&offset=0&limit=50',
|
|
16
|
+
headers: {
|
|
17
|
+
Authorization: `Bearer ${auth}`,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
return ((_b = (_a = response.body) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.rows) || [];
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
console.error('Error fetching campaigns:', error);
|
|
24
|
+
throw new Error('Failed to fetch campaigns.');
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
exports.fetchCampaigns = fetchCampaigns;
|
|
28
|
+
// Add leads to a campaign
|
|
29
|
+
const addLeadsToCampaign = (auth, body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
30
|
+
try {
|
|
31
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
32
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
33
|
+
url: 'https://api.reachinbox.ai/api/v1/leads/add',
|
|
34
|
+
headers: {
|
|
35
|
+
'Content-Type': 'application/json',
|
|
36
|
+
Authorization: `Bearer ${auth}`,
|
|
37
|
+
},
|
|
38
|
+
body,
|
|
39
|
+
});
|
|
40
|
+
return response.body;
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
console.error('Error adding leads:', error);
|
|
44
|
+
throw new Error('Failed to add leads to campaign.');
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
exports.addLeadsToCampaign = addLeadsToCampaign;
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/reachinbox/src/lib/common/index.ts"],"names":[],"mappings":";;;;AAAa,QAAA,gBAAgB,GAAG;IAC9B,OAAO,EAAE,mCAAmC;CAC7C,CAAC;AAEF,+DAAqE;AAgCrE,0CAA0C;AACnC,MAAM,cAAc,GAAG,CAAO,IAAY,EAAuB,EAAE;;IACxE,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAM;YACjD,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,GAAG,EAAE,8EAA8E;YACnF,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,EAAE;aAChC;SACF,CAAC,CAAC;QAEH,OAAO,CAAA,MAAA,MAAA,QAAQ,CAAC,IAAI,0CAAE,IAAI,0CAAE,IAAI,KAAI,EAAE,CAAC;IACzC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;QAClD,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAChD,CAAC;AACH,CAAC,CAAA,CAAC;AAfW,QAAA,cAAc,kBAezB;AAqBF,0BAA0B;AACnB,MAAM,kBAAkB,GAAG,CAChC,IAAY,EACZ,IAAyB,EACE,EAAE;IAC7B,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAmB;YAC9D,MAAM,EAAE,0BAAU,CAAC,IAAI;YACvB,GAAG,EAAE,4CAA4C;YACjD,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,UAAU,IAAI,EAAE;aAChC;YACD,IAAI;SACL,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;AACH,CAAC,CAAA,CAAC;AApBW,QAAA,kBAAkB,sBAoB7B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const campaignCompleted: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
3
|
+
markdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
4
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
5
|
+
markdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
6
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
7
|
+
markdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.campaignCompleted = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const campaignCompletedMessage = `
|
|
7
|
+
Follow the below steps:
|
|
8
|
+
|
|
9
|
+
1. Login to the ReachInbox dashboard.
|
|
10
|
+
2. Go to the "Profile" section and navigate to the "Settings" tab.
|
|
11
|
+
3. Click on the "Integrations" and go to the "Webhooks". Click on the "Add Webhook" button.
|
|
12
|
+
4. Copy the above webhook URL and paste it into the "Webhook URL" field.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
**Test URL (only generate sample data)**:
|
|
16
|
+
\`\`\`text
|
|
17
|
+
{{webhookUrl}}/test
|
|
18
|
+
\`\`\`
|
|
19
|
+
|
|
20
|
+
**Trigger Flow URL**:
|
|
21
|
+
\`\`\`text
|
|
22
|
+
{{webhookUrl}}
|
|
23
|
+
\`\`\`
|
|
24
|
+
|
|
25
|
+
5. Select the event type as "Campaign Completed".
|
|
26
|
+
6. Click on the "Test Trigger" button to simulate a test and capture the webhook response here.
|
|
27
|
+
`;
|
|
28
|
+
exports.campaignCompleted = (0, pieces_framework_1.createTrigger)({
|
|
29
|
+
name: 'campaignCompleted',
|
|
30
|
+
displayName: 'Campaign Completed',
|
|
31
|
+
description: 'Triggers when a campaign is completed.',
|
|
32
|
+
props: {
|
|
33
|
+
markdown: pieces_framework_1.Property.MarkDown({
|
|
34
|
+
value: campaignCompletedMessage,
|
|
35
|
+
}),
|
|
36
|
+
},
|
|
37
|
+
sampleData: {
|
|
38
|
+
email_id: 1,
|
|
39
|
+
lead_id: 1,
|
|
40
|
+
lead_email: 'recipient@example.com',
|
|
41
|
+
email_account: 'sender@example.com',
|
|
42
|
+
step_number: 1,
|
|
43
|
+
message_id: '<test-message-id>',
|
|
44
|
+
timestamp: '2024-03-18T08:15:51.000Z',
|
|
45
|
+
campaign_id: 1,
|
|
46
|
+
campaign_name: 'Test Name',
|
|
47
|
+
event: 'SEQUENCE_COMPLETED',
|
|
48
|
+
user_webhook_id: '1',
|
|
49
|
+
lead_first_name: 'Lead First Name',
|
|
50
|
+
lead_last_name: 'Lead Last Name',
|
|
51
|
+
email_sent_body: 'Sent Email body',
|
|
52
|
+
email_replied_body: 'Sent Replied body',
|
|
53
|
+
},
|
|
54
|
+
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
55
|
+
onEnable(context) {
|
|
56
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
// Implement webhook subscription logic here
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
onDisable(context) {
|
|
61
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
// Implement webhook unsubscription logic here
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
run(context) {
|
|
66
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
return [context.payload.body];
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=campaign-completed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign-completed.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/reachinbox/src/lib/triggers/campaign-completed.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AAGxC,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;GAqB9B,CAAC;AAES,QAAA,iBAAiB,GAAG,IAAA,gCAAa,EAAC;IAC7C,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,wCAAwC;IACrD,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC1B,KAAK,EAAE,wBAAwB;SAChC,CAAC;KACH;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;QACV,UAAU,EAAE,uBAAuB;QACnC,aAAa,EAAE,oBAAoB;QACnC,WAAW,EAAE,CAAC;QACd,UAAU,EAAE,mBAAmB;QAC/B,SAAS,EAAE,0BAA0B;QACrC,WAAW,EAAE,CAAC;QACd,aAAa,EAAE,WAAW;QAC1B,KAAK,EAAE,oBAAoB;QAC3B,eAAe,EAAE,GAAG;QACpB,eAAe,EAAE,iBAAiB;QAClC,cAAc,EAAE,gBAAgB;QAChC,eAAe,EAAE,iBAAiB;QAClC,kBAAkB,EAAE,mBAAmB;KACxC;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,QAAQ,CAAC,OAAO;;YACpB,4CAA4C;QAC9C,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,8CAA8C;QAChD,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const emailBounced: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
3
|
+
markdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
4
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
5
|
+
markdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
6
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
7
|
+
markdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.emailBounced = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const emailBouncedMessage = `
|
|
7
|
+
|
|
8
|
+
Follow the below steps:
|
|
9
|
+
|
|
10
|
+
1. Login to the ReachInbox dashboard.
|
|
11
|
+
2. Go to the "Profile" section and navigate to the "Settings" tab.
|
|
12
|
+
3. Click on the "Integrations" and go to the "Webhooks". Click on the "Add Webhook" button.
|
|
13
|
+
4. Copy the above webhook URL and paste it into the "Webhook URL" field.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
**Test URL (only generate sample data)**:
|
|
17
|
+
\`\`\`text
|
|
18
|
+
{{webhookUrl}}/test
|
|
19
|
+
\`\`\`
|
|
20
|
+
|
|
21
|
+
**Trigger Flow URL**:
|
|
22
|
+
\`\`\`text
|
|
23
|
+
{{webhookUrl}}
|
|
24
|
+
\`\`\`
|
|
25
|
+
|
|
26
|
+
5. Select the event type as "Email Bounced".
|
|
27
|
+
6. Click on the "Test Trigger" button to simulate a test and capture the webhook response here.
|
|
28
|
+
`;
|
|
29
|
+
exports.emailBounced = (0, pieces_framework_1.createTrigger)({
|
|
30
|
+
name: 'emailBounced',
|
|
31
|
+
displayName: 'Email Bounced',
|
|
32
|
+
description: 'Triggers when an email is bounced.',
|
|
33
|
+
props: {
|
|
34
|
+
markdown: pieces_framework_1.Property.MarkDown({
|
|
35
|
+
value: emailBouncedMessage,
|
|
36
|
+
}),
|
|
37
|
+
},
|
|
38
|
+
sampleData: {
|
|
39
|
+
email_id: 1,
|
|
40
|
+
lead_id: 1,
|
|
41
|
+
lead_email: 'recipient@example.com',
|
|
42
|
+
email_account: 'sender@example.com',
|
|
43
|
+
step_number: 1,
|
|
44
|
+
message_id: '<test-message-id>',
|
|
45
|
+
timestamp: '2024-03-18T08:15:51.000Z',
|
|
46
|
+
campaign_id: 1,
|
|
47
|
+
campaign_name: 'Test Name',
|
|
48
|
+
event: 'EMAIL_BOUNCED',
|
|
49
|
+
user_webhook_id: '1',
|
|
50
|
+
lead_first_name: 'Lead First Name',
|
|
51
|
+
lead_last_name: 'Lead Last Name',
|
|
52
|
+
email_sent_body: 'Sent Email body',
|
|
53
|
+
email_replied_body: 'Sent Replied body',
|
|
54
|
+
},
|
|
55
|
+
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
56
|
+
onEnable(context) {
|
|
57
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
// Implement webhook subscription logic here
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
onDisable(context) {
|
|
62
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
// Implement webhook unsubscription logic here
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
run(context) {
|
|
67
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
return [context.payload.body];
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=email-bounced.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-bounced.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/reachinbox/src/lib/triggers/email-bounced.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AAExC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;GAsBzB,CAAC;AAES,QAAA,YAAY,GAAG,IAAA,gCAAa,EAAC;IACxC,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,oCAAoC;IACjD,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC1B,KAAK,EAAE,mBAAmB;SAC3B,CAAC;KACH;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;QACV,UAAU,EAAE,uBAAuB;QACnC,aAAa,EAAE,oBAAoB;QACnC,WAAW,EAAE,CAAC;QACd,UAAU,EAAE,mBAAmB;QAC/B,SAAS,EAAE,0BAA0B;QACrC,WAAW,EAAE,CAAC;QACd,aAAa,EAAE,WAAW;QAC1B,KAAK,EAAE,eAAe;QACtB,eAAe,EAAE,GAAG;QACpB,eAAe,EAAE,iBAAiB;QAClC,cAAc,EAAE,gBAAgB;QAChC,eAAe,EAAE,iBAAiB;QAClC,kBAAkB,EAAE,mBAAmB;KACxC;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,QAAQ,CAAC,OAAO;;YACpB,4CAA4C;QAC9C,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,8CAA8C;QAChD,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const emailOpened: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
3
|
+
markdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
4
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
5
|
+
markdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
6
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
7
|
+
markdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.emailOpened = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const emailOpenedMessage = `
|
|
7
|
+
Follow the below steps:
|
|
8
|
+
|
|
9
|
+
1. Login to the ReachInbox dashboard.
|
|
10
|
+
2. Go to the "Profile" section and navigate to the "Settings" tab.
|
|
11
|
+
3. Click on the "Integrations" and go to the "Webhooks". Click on the "Add Webhook" button.
|
|
12
|
+
4. Copy the above webhook URL and paste it into the "Webhook URL" field.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
**Test URL (only generate sample data)**:
|
|
16
|
+
\`\`\`text
|
|
17
|
+
{{webhookUrl}}/test
|
|
18
|
+
\`\`\`
|
|
19
|
+
|
|
20
|
+
**Trigger Flow URL**:
|
|
21
|
+
\`\`\`text
|
|
22
|
+
{{webhookUrl}}
|
|
23
|
+
\`\`\`
|
|
24
|
+
|
|
25
|
+
5. Select the event type as "Email Opened".
|
|
26
|
+
6. Click on the "Test Trigger" button to simulate a test and capture the webhook response here.
|
|
27
|
+
`;
|
|
28
|
+
exports.emailOpened = (0, pieces_framework_1.createTrigger)({
|
|
29
|
+
name: 'emailOpened',
|
|
30
|
+
displayName: 'Email Opened',
|
|
31
|
+
description: 'Triggers when an email is opened.',
|
|
32
|
+
props: {
|
|
33
|
+
markdown: pieces_framework_1.Property.MarkDown({
|
|
34
|
+
value: emailOpenedMessage,
|
|
35
|
+
}),
|
|
36
|
+
},
|
|
37
|
+
sampleData: {
|
|
38
|
+
email_id: 1,
|
|
39
|
+
lead_id: 1,
|
|
40
|
+
lead_email: 'recipient@example.com',
|
|
41
|
+
email_account: 'sender@example.com',
|
|
42
|
+
step_number: 1,
|
|
43
|
+
message_id: '<test-message-id>',
|
|
44
|
+
timestamp: '2024-03-18T08:15:51.000Z',
|
|
45
|
+
campaign_id: 1,
|
|
46
|
+
campaign_name: 'Test Name',
|
|
47
|
+
event: 'EMAIL_OPENED',
|
|
48
|
+
user_webhook_id: '1',
|
|
49
|
+
lead_first_name: 'Lead First Name',
|
|
50
|
+
lead_last_name: 'Lead Last Name',
|
|
51
|
+
email_sent_body: 'Sent Email body',
|
|
52
|
+
email_replied_body: 'Sent Replied body',
|
|
53
|
+
},
|
|
54
|
+
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
55
|
+
onEnable(context) {
|
|
56
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
// Implement webhook subscription logic here
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
onDisable(context) {
|
|
61
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
// Implement webhook unsubscription logic here
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
run(context) {
|
|
66
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
return [context.payload.body];
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=email-opened.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-opened.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/reachinbox/src/lib/triggers/email-opened.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AAExC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;GAqBxB,CAAC;AAES,QAAA,WAAW,GAAG,IAAA,gCAAa,EAAC;IACvC,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,mCAAmC;IAChD,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC1B,KAAK,EAAE,kBAAkB;SAC1B,CAAC;KACH;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;QACV,UAAU,EAAE,uBAAuB;QACnC,aAAa,EAAE,oBAAoB;QACnC,WAAW,EAAE,CAAC;QACd,UAAU,EAAE,mBAAmB;QAC/B,SAAS,EAAE,0BAA0B;QACrC,WAAW,EAAE,CAAC;QACd,aAAa,EAAE,WAAW;QAC1B,KAAK,EAAE,cAAc;QACrB,eAAe,EAAE,GAAG;QACpB,eAAe,EAAE,iBAAiB;QAClC,cAAc,EAAE,gBAAgB;QAChC,eAAe,EAAE,iBAAiB;QAClC,kBAAkB,EAAE,mBAAmB;KACxC;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,QAAQ,CAAC,OAAO;;YACpB,4CAA4C;QAC9C,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,8CAA8C;QAChD,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const emailSent: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
3
|
+
markdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
4
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
5
|
+
markdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
6
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
7
|
+
markdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.emailSent = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const message = `
|
|
7
|
+
|
|
8
|
+
Follow the below steps:
|
|
9
|
+
|
|
10
|
+
1. Login to the ReachInbox dashboard.
|
|
11
|
+
2. Go to the "Profile" section and navigate to the "Settings" tab.
|
|
12
|
+
3. Click on the "Integrations" and go to the "Webhooks". Click on the "Add Webhook" button.
|
|
13
|
+
4. Copy the above webhook URL and paste it into the "Webhook URL" field.
|
|
14
|
+
|
|
15
|
+
**Test URL (only generate sample data)**:
|
|
16
|
+
\`\`\`text
|
|
17
|
+
{{webhookUrl}}/test
|
|
18
|
+
\`\`\`
|
|
19
|
+
|
|
20
|
+
**Trigger Flow URL**:
|
|
21
|
+
\`\`\`text
|
|
22
|
+
{{webhookUrl}}
|
|
23
|
+
\`\`\`
|
|
24
|
+
|
|
25
|
+
5. Select the event type as "Email Sent".
|
|
26
|
+
6. Click on the "Test Trigger" button to simulate a test and capture the webhook response here.
|
|
27
|
+
`;
|
|
28
|
+
exports.emailSent = (0, pieces_framework_1.createTrigger)({
|
|
29
|
+
name: 'emailSent',
|
|
30
|
+
displayName: 'Email Sent',
|
|
31
|
+
description: 'Triggers when an email is successfully sent.',
|
|
32
|
+
props: {
|
|
33
|
+
markdown: pieces_framework_1.Property.MarkDown({
|
|
34
|
+
value: message,
|
|
35
|
+
}),
|
|
36
|
+
},
|
|
37
|
+
sampleData: {
|
|
38
|
+
email_id: 1,
|
|
39
|
+
lead_id: 1,
|
|
40
|
+
lead_email: 'recipient@example.com',
|
|
41
|
+
email_account: 'sender@example.com',
|
|
42
|
+
step_number: 1,
|
|
43
|
+
message_id: '<test-message-id>',
|
|
44
|
+
timestamp: '2024-03-18T08:15:51.000Z',
|
|
45
|
+
campaign_id: 1,
|
|
46
|
+
campaign_name: 'Test Name',
|
|
47
|
+
event: 'EMAIL_SENT',
|
|
48
|
+
user_webhook_id: '1',
|
|
49
|
+
lead_first_name: 'Lead First Name',
|
|
50
|
+
lead_last_name: 'Lead Last Name',
|
|
51
|
+
email_sent_body: 'Sent Email body',
|
|
52
|
+
email_replied_body: 'Sent Replied body',
|
|
53
|
+
},
|
|
54
|
+
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
55
|
+
onEnable(context) {
|
|
56
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
// Here you would implement logic to enable the webhook with the external service
|
|
58
|
+
// Possibly create a webhook subscription by sending the webhook URL (context.webhookUrl) to the external service
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
onDisable(context) {
|
|
62
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
// Here you would implement logic to disable or delete the webhook subscription from the external service
|
|
64
|
+
// Likely sending a DELETE request to the service to remove the webhook
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
run(context) {
|
|
68
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
// This will handle the incoming webhook event and return the payload data
|
|
70
|
+
return [context.payload.body];
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
//# sourceMappingURL=email-sent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-sent.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/reachinbox/src/lib/triggers/email-sent.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AAExC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;CAqBf,CAAC;AAEW,QAAA,SAAS,GAAG,IAAA,gCAAa,EAAC;IACrC,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,8CAA8C;IAC3D,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC1B,KAAK,EAAE,OAAO;SACf,CAAC;KACH;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;QACV,UAAU,EAAE,uBAAuB;QACnC,aAAa,EAAE,oBAAoB;QACnC,WAAW,EAAE,CAAC;QACd,UAAU,EAAE,mBAAmB;QAC/B,SAAS,EAAE,0BAA0B;QACrC,WAAW,EAAE,CAAC;QACd,aAAa,EAAE,WAAW;QAC1B,KAAK,EAAE,YAAY;QACnB,eAAe,EAAE,GAAG;QACpB,eAAe,EAAE,iBAAiB;QAClC,cAAc,EAAE,gBAAgB;QAChC,eAAe,EAAE,iBAAiB;QAClC,kBAAkB,EAAE,mBAAmB;KACxC;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IAEvB,QAAQ,CAAC,OAAO;;YACpB,iFAAiF;YACjF,iHAAiH;QACnH,CAAC;KAAA;IAEK,SAAS,CAAC,OAAO;;YACrB,yGAAyG;YACzG,uEAAuE;QACzE,CAAC;KAAA;IAEK,GAAG,CAAC,OAAO;;YACf,0EAA0E;YAC1E,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const leadInterested: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
3
|
+
markdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
4
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
5
|
+
markdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
6
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
7
|
+
markdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
8
|
+
}>;
|