Skip to content

Commit 43c286b

Browse files
authored
Merge pull request #22 from squaredup/work/rb/sendgrid
SendGrid plugin
2 parents 6eb4cc7 + 0666d25 commit 43c286b

26 files changed

Lines changed: 2235 additions & 0 deletions

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ plugins/Postcoder/* @richbenwell
1313
plugins/RDAP/* @richbenwell
1414
plugins/RSS/* @clarkd
1515
plugins/Rootly/* @noorulkhan-n
16+
plugins/SendGrid/* @richbenwell
1617
plugins/Spotify/* @jame2O
1718
plugins/Steam/* @kmichalski0
1819
plugins/SumoLogic/* @richpeters

plugins/SendGrid/v1/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Overview
2+
3+
A plugin for Twilio SendGrid, a popular SMTP server.
4+
5+
The plugin provides email send stats and unsubscribes, allowing software and marketing teams to report on email performance.
6+
7+
## Setup
8+
9+
Authentication is via API key.
10+
11+
Create an API key in https://app.sendgrid.com/settings/api_keys
12+
13+
Select 'Custom Access' and configure the following permissions:
14+
- Stats (read-only)
15+
- Suppressions (read-only)
16+
17+
## Known limitations
18+
19+
Account credits cannot be monitored using this plugin. Although an API endpoint is available, it seems to require an API key with full admin access.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"name": "allClientStats",
3+
"displayName": "All Client Stats",
4+
"baseDataSourceName": "httpRequestUnscoped",
5+
"config": {
6+
"httpMethod": "get",
7+
"paging": {
8+
"mode": "none"
9+
},
10+
"expandInnerObjects": true,
11+
"endpointPath": "/clients/stats",
12+
"getArgs": [
13+
{
14+
"key": "start_date",
15+
"value": "{{timeframe.start.substring(0,10)}}"
16+
},
17+
{
18+
"key": "aggregated_by",
19+
"value": "day"
20+
},
21+
{
22+
"key": "limit",
23+
"value": "100"
24+
},
25+
{
26+
"key": "end_date",
27+
"value": "{{timeframe.end.substring(0,10)}}"
28+
}
29+
],
30+
"postRequestScript": "script1-post.js",
31+
"headers": []
32+
},
33+
"metadata": [
34+
{
35+
"shape": [
36+
"date",
37+
{
38+
"timeZone": "Etc/UTC"
39+
}
40+
],
41+
"name": "date"
42+
},
43+
{
44+
"shape": [
45+
"number",
46+
{
47+
"decimalPlaces": 0
48+
}
49+
],
50+
"name": "metrics.opens"
51+
},
52+
{
53+
"shape": [
54+
"number",
55+
{
56+
"decimalPlaces": 0
57+
}
58+
],
59+
"name": "metrics.unique_opens"
60+
},
61+
{
62+
"pattern": ".*"
63+
}
64+
],
65+
"timeframes": true
66+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "blocks",
3+
"displayName": "Blocks",
4+
"baseDataSourceName": "httpRequestUnscoped",
5+
"config": {
6+
"httpMethod": "get",
7+
"paging": {
8+
"mode": "none"
9+
},
10+
"expandInnerObjects": true,
11+
"endpointPath": "/suppression/blocks",
12+
"getArgs": [
13+
{
14+
"key": "start_time",
15+
"value": "{{timeframe.unixStart}}"
16+
},
17+
{
18+
"key": "end_time",
19+
"value": "{{timeframe.unixEnd}}"
20+
},
21+
{
22+
"key": "limit",
23+
"value": "500"
24+
}
25+
],
26+
"pathToData": "",
27+
"headers": []
28+
},
29+
"metadata": [
30+
{
31+
"shape": [
32+
"date",
33+
{
34+
"timeZone": "Etc/UTC"
35+
}
36+
],
37+
"name": "created"
38+
},
39+
{
40+
"pattern": ".*"
41+
}
42+
],
43+
"timeframes": true
44+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "bounces",
3+
"displayName": "Bounces",
4+
"baseDataSourceName": "httpRequestUnscoped",
5+
"config": {
6+
"httpMethod": "get",
7+
"paging": {
8+
"mode": "none"
9+
},
10+
"expandInnerObjects": true,
11+
"endpointPath": "/suppression/bounces",
12+
"getArgs": [
13+
{
14+
"key": "start_time",
15+
"value": "{{timeframe.unixStart}}"
16+
},
17+
{
18+
"key": "end_time",
19+
"value": "{{timeframe.unixEnd}}"
20+
},
21+
{
22+
"key": "limit",
23+
"value": "500"
24+
}
25+
],
26+
"pathToData": "",
27+
"headers": []
28+
},
29+
"metadata": [
30+
{
31+
"shape": [
32+
"date",
33+
{
34+
"timeZone": "Etc/UTC"
35+
}
36+
],
37+
"name": "created"
38+
},
39+
{
40+
"pattern": ".*"
41+
}
42+
],
43+
"timeframes": true
44+
}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{
2+
"name": "browserStats",
3+
"displayName": "Browser Stats",
4+
"baseDataSourceName": "httpRequestUnscoped",
5+
"config": {
6+
"httpMethod": "get",
7+
"paging": {
8+
"mode": "none"
9+
},
10+
"expandInnerObjects": true,
11+
"endpointPath": "/browsers/stats",
12+
"getArgs": [
13+
{
14+
"key": "start_date",
15+
"value": "{{timeframe.start.substring(0,10)}}"
16+
},
17+
{
18+
"key": "end_date",
19+
"value": "{{timeframe.end.substring(0,10)}}"
20+
},
21+
{
22+
"key": "aggregated_by",
23+
"value": "{{aggregated_by}}"
24+
},
25+
{
26+
"key": "limit",
27+
"value": "1000"
28+
}
29+
],
30+
"postRequestScript": "script1-post.js",
31+
"headers": []
32+
},
33+
"ui": [
34+
{
35+
"name": "aggregated_by",
36+
"type": "autocomplete",
37+
"label": "Aggregate by",
38+
"validation": {
39+
"required": true
40+
},
41+
"allowCustomValues": false,
42+
"isMulti": false,
43+
"defaultValue": "day",
44+
"data": {
45+
"source": "fixed",
46+
"values": [
47+
{
48+
"value": "day",
49+
"label": "Day"
50+
},
51+
{
52+
"value": "week",
53+
"label": "Week"
54+
},
55+
{
56+
"value": "month",
57+
"label": "Month"
58+
}
59+
]
60+
}
61+
}
62+
],
63+
"metadata": [
64+
{
65+
"shape": [
66+
"date",
67+
{
68+
"timeZone": "Etc/UTC"
69+
}
70+
],
71+
"name": "date"
72+
},
73+
{
74+
"shape": [
75+
"number",
76+
{
77+
"decimalPlaces": 0
78+
}
79+
],
80+
"name": "metrics.clicks"
81+
},
82+
{
83+
"shape": [
84+
"number",
85+
{
86+
"decimalPlaces": 0
87+
}
88+
],
89+
"name": "metrics.unique_clicks"
90+
},
91+
{
92+
"pattern": ".*"
93+
}
94+
],
95+
"timeframes": true
96+
}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{
2+
"name": "clientTypeStats",
3+
"displayName": "Client Type Stats",
4+
"baseDataSourceName": "httpRequestUnscoped",
5+
"config": {
6+
"httpMethod": "get",
7+
"paging": {
8+
"mode": "none"
9+
},
10+
"expandInnerObjects": true,
11+
"endpointPath": "/clients/desktop/stats",
12+
"getArgs": [
13+
{
14+
"key": "start_date",
15+
"value": "{{timeframe.start.substring(0,10)}}"
16+
},
17+
{
18+
"key": "end_date",
19+
"value": "{{timeframe.end.substring(0,10)}}"
20+
},
21+
{
22+
"key": "aggregated_by",
23+
"value": "{{aggregated_by}}"
24+
},
25+
{
26+
"key": "limit",
27+
"value": "1000"
28+
}
29+
],
30+
"postRequestScript": "script1-post.js",
31+
"headers": []
32+
},
33+
"ui": [
34+
{
35+
"name": "aggregated_by",
36+
"type": "autocomplete",
37+
"label": "Aggregate by",
38+
"validation": {
39+
"required": true
40+
},
41+
"allowCustomValues": false,
42+
"isMulti": false,
43+
"defaultValue": "day",
44+
"data": {
45+
"source": "fixed",
46+
"values": [
47+
{
48+
"value": "day",
49+
"label": "Day"
50+
},
51+
{
52+
"value": "week",
53+
"label": "Week"
54+
},
55+
{
56+
"value": "month",
57+
"label": "Month"
58+
}
59+
]
60+
}
61+
}
62+
],
63+
"metadata": [
64+
{
65+
"shape": [
66+
"date",
67+
{
68+
"timeZone": "Etc/UTC"
69+
}
70+
],
71+
"name": "date"
72+
},
73+
{
74+
"shape": [
75+
"number",
76+
{
77+
"decimalPlaces": 0
78+
}
79+
],
80+
"name": "metrics.opens"
81+
},
82+
{
83+
"shape": [
84+
"number",
85+
{
86+
"decimalPlaces": 0
87+
}
88+
],
89+
"name": "metrics.unique_opens"
90+
},
91+
{
92+
"pattern": ".*"
93+
}
94+
],
95+
"timeframes": true
96+
}

0 commit comments

Comments
 (0)