@pipedream/reachmail 0.0.1 → 0.2.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/README.md +11 -0
- package/actions/list-list-id-options/list-list-id-options.mjs +26 -0
- package/actions/opt-out-recipient-from-list/opt-out-recipient-from-list.mjs +41 -0
- package/package.json +4 -1
- package/reachmail.app.mjs +74 -5
- package/sources/common/base.mjs +49 -0
- package/sources/new-bounce-instant/new-bounce-instant.mjs +22 -0
- package/sources/new-bounce-instant/test-event.mjs +39 -0
- package/sources/new-click-instant/new-click-instant.mjs +22 -0
- package/sources/new-click-instant/test-event.mjs +39 -0
- package/sources/new-open-instant/new-open-instant.mjs +22 -0
- package/sources/new-open-instant/test-event.mjs +39 -0
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
The ReachMail API lets you seamlessly integrate email marketing capabilities into your workflows on Pipedream. With it, you can automate email list management, campaign creation, and performance tracking. This flexibility opens up possibilities for custom email marketing automation, audience segmentation, and targeted outreach based on user actions or data from other apps. By harnessing the power of Pipedream's serverless platform, you can build workflows that trigger from various events and connect with numerous other services to create a sophisticated, automated email marketing machine.
|
|
4
|
+
|
|
5
|
+
# Example Use Cases
|
|
6
|
+
|
|
7
|
+
- **Automated Campaign Creation from Webhooks**: Trigger an email campaign in ReachMail when a specific event occurs in your app. For instance, you could set up a Pipedream workflow where a new sign-up on your platform via a webhook triggers a welcome email sequence in ReachMail.
|
|
8
|
+
|
|
9
|
+
- **Dynamic Audience Segmentation with Google Sheets**: Maintain a Google Sheet with contact information and preferences. Use a Pipedream workflow to periodically sync this data to ReachMail, automatically updating email lists for targeted campaigns based on the latest data.
|
|
10
|
+
|
|
11
|
+
- **Performance-Driven Emails with ReachMail and Slack**: Monitor your email campaign performance with ReachMail, and use Pipedream to send summary reports or alerts to a Slack channel when key metrics hit certain thresholds, ensuring that your team stays informed about your marketing efforts in real time.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import reachmail from "../../reachmail.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "reachmail-list-list-id-options",
|
|
5
|
+
name: "List List ID Options",
|
|
6
|
+
description: "Retrieves available options for the List ID field.",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
reachmail,
|
|
16
|
+
},
|
|
17
|
+
async run({ $ }) {
|
|
18
|
+
const options = await reachmail.propDefinitions.listId.options.call(this.reachmail, {});
|
|
19
|
+
$.export("$summary", `Successfully retrieved ${options.length} option${
|
|
20
|
+
options.length === 1
|
|
21
|
+
? ""
|
|
22
|
+
: "s"
|
|
23
|
+
}`);
|
|
24
|
+
return options;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import reachmail from "../../reachmail.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "reachmail-opt-out-recipient-from-list",
|
|
5
|
+
name: "Opt Out Recipient From List",
|
|
6
|
+
description: "The action will remove the recipient from the specified list. [See the documentation](https://services.reachmail.net/)",
|
|
7
|
+
version: "0.0.2",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: true,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
reachmail,
|
|
16
|
+
recipient: {
|
|
17
|
+
type: "string",
|
|
18
|
+
label: "Recipient Email",
|
|
19
|
+
description: "The email address of the recipient.",
|
|
20
|
+
},
|
|
21
|
+
listId: {
|
|
22
|
+
propDefinition: [
|
|
23
|
+
reachmail,
|
|
24
|
+
"listId",
|
|
25
|
+
],
|
|
26
|
+
type: "string",
|
|
27
|
+
description: "The ID of the list from which the recipient should be opted out.",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
async run({ $ }) {
|
|
31
|
+
const response = await this.reachmail.optOutRecipient({
|
|
32
|
+
$,
|
|
33
|
+
listId: this.listId,
|
|
34
|
+
data: {
|
|
35
|
+
Email: this.recipient,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
$.export("$summary", `Successfully opted out ${this.recipient} from list ${this.listId}`);
|
|
39
|
+
return response;
|
|
40
|
+
},
|
|
41
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/reachmail",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Pipedream ReachMail Components",
|
|
5
5
|
"main": "reachmail.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -11,5 +11,8 @@
|
|
|
11
11
|
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@pipedream/platform": "^1.6.8"
|
|
14
17
|
}
|
|
15
18
|
}
|
package/reachmail.app.mjs
CHANGED
|
@@ -1,11 +1,80 @@
|
|
|
1
|
+
import { axios } from "@pipedream/platform";
|
|
2
|
+
|
|
1
3
|
export default {
|
|
2
4
|
type: "app",
|
|
3
5
|
app: "reachmail",
|
|
4
|
-
propDefinitions: {
|
|
6
|
+
propDefinitions: {
|
|
7
|
+
listId: {
|
|
8
|
+
type: "string[]",
|
|
9
|
+
label: "List ID",
|
|
10
|
+
description: "The list ID related to the new campaign.",
|
|
11
|
+
async options() {
|
|
12
|
+
const data = await this.listLists();
|
|
13
|
+
|
|
14
|
+
return data.map(({
|
|
15
|
+
Id: value, Name: label,
|
|
16
|
+
}) => ({
|
|
17
|
+
label,
|
|
18
|
+
value,
|
|
19
|
+
}));
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
5
23
|
methods: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
24
|
+
_baseUrl() {
|
|
25
|
+
return "https://services.reachmail.net";
|
|
26
|
+
},
|
|
27
|
+
_headers() {
|
|
28
|
+
return {
|
|
29
|
+
"Authorization": `Bearer ${this.$auth.api_token}`,
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
_makeRequest({
|
|
33
|
+
$ = this, path, ...opts
|
|
34
|
+
}) {
|
|
35
|
+
return axios($, {
|
|
36
|
+
url: this._baseUrl() + path,
|
|
37
|
+
headers: this._headers(),
|
|
38
|
+
...opts,
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
createWebhook({
|
|
42
|
+
action, ...opts
|
|
43
|
+
}) {
|
|
44
|
+
return this._makeRequest({
|
|
45
|
+
method: "POST",
|
|
46
|
+
path: `/Webhooks/${action}`,
|
|
47
|
+
...opts,
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
deleteWebhook(action) {
|
|
51
|
+
return this._makeRequest({
|
|
52
|
+
method: "DELETE",
|
|
53
|
+
path: `/Webhooks/${action}`,
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
updateWebhook({
|
|
57
|
+
hookId, ...opts
|
|
58
|
+
}) {
|
|
59
|
+
return this._makeRequest({
|
|
60
|
+
method: "PUT",
|
|
61
|
+
path: `/Webhooks/${hookId}`,
|
|
62
|
+
...opts,
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
listLists() {
|
|
66
|
+
return this._makeRequest({
|
|
67
|
+
path: "/Lists",
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
optOutRecipient({
|
|
71
|
+
listId, ...opts
|
|
72
|
+
}) {
|
|
73
|
+
return this._makeRequest({
|
|
74
|
+
method: "POST",
|
|
75
|
+
path: `/Lists/OptOut/${listId}`,
|
|
76
|
+
...opts,
|
|
77
|
+
});
|
|
9
78
|
},
|
|
10
79
|
},
|
|
11
|
-
};
|
|
80
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import reachmail from "../../reachmail.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
props: {
|
|
5
|
+
reachmail,
|
|
6
|
+
http: "$.interface.http",
|
|
7
|
+
db: "$.service.db",
|
|
8
|
+
},
|
|
9
|
+
methods: {
|
|
10
|
+
_setHookId(Id) {
|
|
11
|
+
this.db.set("hookId", Id);
|
|
12
|
+
},
|
|
13
|
+
_getHookId() {
|
|
14
|
+
return this.db.get("hookId");
|
|
15
|
+
},
|
|
16
|
+
emitData(body) {
|
|
17
|
+
this.$emit(body, {
|
|
18
|
+
id: body.Signature,
|
|
19
|
+
summary: this.getSummary(body),
|
|
20
|
+
ts: Date.parse(body.Timestamp),
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
hooks: {
|
|
25
|
+
async activate() {
|
|
26
|
+
const response = await this.reachmail.createWebhook({
|
|
27
|
+
action: this.getAction(),
|
|
28
|
+
data: {
|
|
29
|
+
Url: this.http.endpoint,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
this._setHookId(response.Id);
|
|
33
|
+
},
|
|
34
|
+
async deactivate() {
|
|
35
|
+
const hookId = this._getHookId();
|
|
36
|
+
|
|
37
|
+
await this.reachmail.updateWebhook({
|
|
38
|
+
hookId,
|
|
39
|
+
data: {
|
|
40
|
+
Url: this.http.endpoint,
|
|
41
|
+
Active: false,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
async run({ body }) {
|
|
47
|
+
this.emitData(body);
|
|
48
|
+
},
|
|
49
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import common from "../common/base.mjs";
|
|
2
|
+
import sampleEmit from "./test-event.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
...common,
|
|
6
|
+
key: "reachmail-new-bounce-instant",
|
|
7
|
+
name: "New Bounce Instant",
|
|
8
|
+
description: "Emit new event when a recipient's email address bounces.",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "source",
|
|
11
|
+
dedupe: "unique",
|
|
12
|
+
methods: {
|
|
13
|
+
...common.methods,
|
|
14
|
+
getAction() {
|
|
15
|
+
return "Bounce";
|
|
16
|
+
},
|
|
17
|
+
getSummary(body) {
|
|
18
|
+
return `New bounce: ${body.Email}`;
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
sampleEmit,
|
|
22
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"body": {
|
|
3
|
+
"Device": {
|
|
4
|
+
"ClientName": null,
|
|
5
|
+
"ClientOs": "Unknown",
|
|
6
|
+
"ClientType": "Other",
|
|
7
|
+
"DeviceType": "Desktop"
|
|
8
|
+
},
|
|
9
|
+
"Email": "webhook@reachmail.net",
|
|
10
|
+
"EventId": "9d2360cd-e094-4586-9125-ffcc9c713f58",
|
|
11
|
+
"EventType": "bounce",
|
|
12
|
+
"IpAddress": "123.11.32.1",
|
|
13
|
+
"Location": {
|
|
14
|
+
"City": "Chicago",
|
|
15
|
+
"CountryCode": "US",
|
|
16
|
+
"Region": "IL"
|
|
17
|
+
},
|
|
18
|
+
"RecipientId": "20b64129-c0a1-42bc-9453-209a28f7bd51",
|
|
19
|
+
"Signature": "816fb208ea0cb491f81b171d6d5d91d0de850b37156e1322fabccd2e2ed5cd64",
|
|
20
|
+
"Timestamp": 1710169299,
|
|
21
|
+
"Token": "xeeggtwycyqgcpemxduirulpdpmjbksejmkocvkjffwjefpnph",
|
|
22
|
+
"Url": null,
|
|
23
|
+
"UserAgent": "Mozilla/firefox",
|
|
24
|
+
"XCampaign": "Campaign Name"
|
|
25
|
+
},
|
|
26
|
+
"client_ip": "123.11.32.1",
|
|
27
|
+
"headers": {
|
|
28
|
+
"accept": "text/html, application/xhtml+xml, application/xml; q=0.9, image/webp, */*; q=0.8",
|
|
29
|
+
"accept-encoding": "gzip, deflate, sdch, br",
|
|
30
|
+
"content-length": "569",
|
|
31
|
+
"content-type": "application/json; charset=utf-8",
|
|
32
|
+
"host": "urltest.com",
|
|
33
|
+
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15"
|
|
34
|
+
},
|
|
35
|
+
"method": "POST",
|
|
36
|
+
"path": "/",
|
|
37
|
+
"query": {},
|
|
38
|
+
"url": "https://urltest.com/"
|
|
39
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import common from "../common/base.mjs";
|
|
2
|
+
import sampleEmit from "./test-event.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
...common,
|
|
6
|
+
key: "reachmail-new-click-instant",
|
|
7
|
+
name: "New Click Instant",
|
|
8
|
+
description: "Emit new event when a recipient clicks on an email.",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "source",
|
|
11
|
+
dedupe: "unique",
|
|
12
|
+
methods: {
|
|
13
|
+
...common.methods,
|
|
14
|
+
getAction() {
|
|
15
|
+
return "Click";
|
|
16
|
+
},
|
|
17
|
+
getSummary(body) {
|
|
18
|
+
return `New click from ${body.Email}`;
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
sampleEmit,
|
|
22
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"body": {
|
|
3
|
+
"Device": {
|
|
4
|
+
"ClientName": null,
|
|
5
|
+
"ClientOs": "Unknown",
|
|
6
|
+
"ClientType": "Other",
|
|
7
|
+
"DeviceType": "Desktop"
|
|
8
|
+
},
|
|
9
|
+
"Email": "webhook@reachmail.net",
|
|
10
|
+
"EventId": "9d2360cd-e094-4586-9125-ffcc9c713f58",
|
|
11
|
+
"EventType": "click",
|
|
12
|
+
"IpAddress": "123.11.32.1",
|
|
13
|
+
"Location": {
|
|
14
|
+
"City": "Chicago",
|
|
15
|
+
"CountryCode": "US",
|
|
16
|
+
"Region": "IL"
|
|
17
|
+
},
|
|
18
|
+
"RecipientId": "20b64129-c0a1-42bc-9453-209a28f7bd51",
|
|
19
|
+
"Signature": "816fb208ea0cb491f81b171d6d5d91d0de850b37156e1322fabccd2e2ed5cd64",
|
|
20
|
+
"Timestamp": 1710169299,
|
|
21
|
+
"Token": "xeeggtwycyqgcpemxduirulpdpmjbksejmkocvkjffwjefpnph",
|
|
22
|
+
"Url": null,
|
|
23
|
+
"UserAgent": "Mozilla/firefox",
|
|
24
|
+
"XCampaign": "Campaign Name"
|
|
25
|
+
},
|
|
26
|
+
"client_ip": "123.11.32.1",
|
|
27
|
+
"headers": {
|
|
28
|
+
"accept": "text/html, application/xhtml+xml, application/xml; q=0.9, image/webp, */*; q=0.8",
|
|
29
|
+
"accept-encoding": "gzip, deflate, sdch, br",
|
|
30
|
+
"content-length": "569",
|
|
31
|
+
"content-type": "application/json; charset=utf-8",
|
|
32
|
+
"host": "urltest.com",
|
|
33
|
+
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15"
|
|
34
|
+
},
|
|
35
|
+
"method": "POST",
|
|
36
|
+
"path": "/",
|
|
37
|
+
"query": {},
|
|
38
|
+
"url": "https://urltest.com/"
|
|
39
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import common from "../common/base.mjs";
|
|
2
|
+
import sampleEmit from "./test-event.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
...common,
|
|
6
|
+
key: "reachmail-new-open-instant",
|
|
7
|
+
name: "New Email Open Instant",
|
|
8
|
+
description: "Emit new event when a recipient opens an email.",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "source",
|
|
11
|
+
dedupe: "unique",
|
|
12
|
+
methods: {
|
|
13
|
+
...common.methods,
|
|
14
|
+
getAction() {
|
|
15
|
+
return "Open";
|
|
16
|
+
},
|
|
17
|
+
getSummary(body) {
|
|
18
|
+
return `Email opened by ${body.Email}`;
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
sampleEmit,
|
|
22
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"body": {
|
|
3
|
+
"Device": {
|
|
4
|
+
"ClientName": null,
|
|
5
|
+
"ClientOs": "Unknown",
|
|
6
|
+
"ClientType": "Other",
|
|
7
|
+
"DeviceType": "Desktop"
|
|
8
|
+
},
|
|
9
|
+
"Email": "webhook@reachmail.net",
|
|
10
|
+
"EventId": "9d2360cd-e094-4586-9125-ffcc9c713f58",
|
|
11
|
+
"EventType": "open",
|
|
12
|
+
"IpAddress": "123.11.32.1",
|
|
13
|
+
"Location": {
|
|
14
|
+
"City": "Chicago",
|
|
15
|
+
"CountryCode": "US",
|
|
16
|
+
"Region": "IL"
|
|
17
|
+
},
|
|
18
|
+
"RecipientId": "20b64129-c0a1-42bc-9453-209a28f7bd51",
|
|
19
|
+
"Signature": "816fb208ea0cb491f81b171d6d5d91d0de850b37156e1322fabccd2e2ed5cd64",
|
|
20
|
+
"Timestamp": 1710169299,
|
|
21
|
+
"Token": "xeeggtwycyqgcpemxduirulpdpmjbksejmkocvkjffwjefpnph",
|
|
22
|
+
"Url": null,
|
|
23
|
+
"UserAgent": "Mozilla/firefox",
|
|
24
|
+
"XCampaign": "Campaign Name"
|
|
25
|
+
},
|
|
26
|
+
"client_ip": "123.11.32.1",
|
|
27
|
+
"headers": {
|
|
28
|
+
"accept": "text/html, application/xhtml+xml, application/xml; q=0.9, image/webp, */*; q=0.8",
|
|
29
|
+
"accept-encoding": "gzip, deflate, sdch, br",
|
|
30
|
+
"content-length": "569",
|
|
31
|
+
"content-type": "application/json; charset=utf-8",
|
|
32
|
+
"host": "urltest.com",
|
|
33
|
+
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15"
|
|
34
|
+
},
|
|
35
|
+
"method": "POST",
|
|
36
|
+
"path": "/",
|
|
37
|
+
"query": {},
|
|
38
|
+
"url": "https://urltest.com/"
|
|
39
|
+
}
|