@mailchannels/n8n-nodes-mailchannels 0.0.0 → 0.1.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/LICENSE +21 -0
- package/README.md +72 -4
- package/dist/credentials/MailChannelsApi.credentials.d.ts +10 -0
- package/dist/credentials/MailChannelsApi.credentials.js +36 -0
- package/dist/credentials/MailChannelsApi.credentials.js.map +1 -0
- package/dist/credentials/mailchannels.svg +4 -0
- package/dist/nodes/MailChannels/MailChannels.node.d.ts +5 -0
- package/dist/nodes/MailChannels/MailChannels.node.js +353 -0
- package/dist/nodes/MailChannels/MailChannels.node.js.map +1 -0
- package/dist/nodes/MailChannels/mailchannels.svg +4 -0
- package/package.json +50 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MailChannels
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,6 +1,74 @@
|
|
|
1
|
-
#
|
|
1
|
+
# n8n-nodes-mailchannels
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
An [n8n](https://n8n.io/) community node for sending email with the
|
|
4
|
+
[MailChannels Email API](https://docs.mailchannels.com/email-api/overview).
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
Follow the n8n guide to [installing community nodes](https://docs.n8n.io/integrations/community-nodes/installation/)
|
|
9
|
+
and install `@mailchannels/n8n-nodes-mailchannels`.
|
|
10
|
+
|
|
11
|
+
## Credentials
|
|
12
|
+
|
|
13
|
+
Create a **MailChannels API** credential with your Email API key. The credential
|
|
14
|
+
test calls `GET /usage` and never sends email.
|
|
15
|
+
|
|
16
|
+
## Operations
|
|
17
|
+
|
|
18
|
+
The **Email** resource has two operations:
|
|
19
|
+
|
|
20
|
+
- **Validate** (default) checks a message with the API without delivering it.
|
|
21
|
+
- **Send** sends the message.
|
|
22
|
+
|
|
23
|
+
**Input Mode** chooses how you describe the message:
|
|
24
|
+
|
|
25
|
+
- **JSON** (default) takes an Email API request body with `from`, `personalizations`,
|
|
26
|
+
`subject` and `content`. Use it for named recipients, several content parts,
|
|
27
|
+
personalizations or other API options.
|
|
28
|
+
- **Fields** covers a single message: sender, comma-separated To addresses, subject,
|
|
29
|
+
text or HTML body, and optional CC, BCC, reply-to and sender name. Addresses in
|
|
30
|
+
this mode can't include display names.
|
|
31
|
+
|
|
32
|
+
Both drafts stay editable when you switch modes; only the selected mode is validated
|
|
33
|
+
and sent. **Attachment Binary Fields** takes a comma-separated list of binary
|
|
34
|
+
properties to attach from the incoming item. Expressions resolve for each item.
|
|
35
|
+
|
|
36
|
+
## Limits and retries
|
|
37
|
+
|
|
38
|
+
- An email can have at most 1,000 attachments, and the node rejects a serialized
|
|
39
|
+
request larger than 30,000,000 bytes before sending. MailChannels separately
|
|
40
|
+
enforces its 30 MB message limit.
|
|
41
|
+
- Requests go only to `https://api.mailchannels.net`, don't follow redirects and
|
|
42
|
+
time out after 30 seconds. The node never retries on its own.
|
|
43
|
+
- An API acceptance is not a delivery. If a send fails after the request was made,
|
|
44
|
+
the message may still have been accepted, so check before sending it again.
|
|
45
|
+
Leave **Retry On Fail** off for Send: each retry sends another copy.
|
|
46
|
+
- With **Continue On Fail**, failed items return a sanitized error paired with
|
|
47
|
+
their input, and later items still run.
|
|
48
|
+
|
|
49
|
+
## Development
|
|
50
|
+
|
|
51
|
+
Requires Node.js 24 or later.
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
npm ci
|
|
55
|
+
npm run lint
|
|
56
|
+
npm run build
|
|
57
|
+
npm test
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Releases
|
|
61
|
+
|
|
62
|
+
Pushing a version tag such as `0.1.0` runs `.github/workflows/publish.yml`, which
|
|
63
|
+
publishes to npm with a provenance statement, as n8n requires for verified
|
|
64
|
+
community nodes.
|
|
65
|
+
|
|
66
|
+
## Support
|
|
67
|
+
|
|
68
|
+
Open an issue at https://github.com/mailchannels/n8n-nodes-mailchannels/issues or
|
|
69
|
+
email dev@mailchannels.com. MailChannels customers with a problem with the
|
|
70
|
+
MailChannels service can get support at https://support.mailchannels.com/.
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ICredentialTestRequest, Icon, IAuthenticateGeneric, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class MailChannelsApi implements ICredentialType {
|
|
3
|
+
icon: Icon;
|
|
4
|
+
test: ICredentialTestRequest;
|
|
5
|
+
name: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
documentationUrl: string;
|
|
8
|
+
properties: INodeProperties[];
|
|
9
|
+
authenticate: IAuthenticateGeneric;
|
|
10
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MailChannelsApi = void 0;
|
|
4
|
+
class MailChannelsApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.icon = { light: 'file:mailchannels.svg', dark: 'file:mailchannels.svg' };
|
|
7
|
+
this.test = {
|
|
8
|
+
request: {
|
|
9
|
+
baseURL: 'https://api.mailchannels.net/tx/v1',
|
|
10
|
+
url: '/usage',
|
|
11
|
+
method: 'GET',
|
|
12
|
+
disableFollowRedirect: true,
|
|
13
|
+
timeout: 30000,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
this.name = 'mailChannelsApi';
|
|
17
|
+
this.displayName = 'MailChannels API';
|
|
18
|
+
this.documentationUrl = 'https://docs.mailchannels.com/email-api/overview';
|
|
19
|
+
this.properties = [
|
|
20
|
+
{
|
|
21
|
+
displayName: 'API Key',
|
|
22
|
+
name: 'apiKey',
|
|
23
|
+
type: 'string',
|
|
24
|
+
typeOptions: { password: true },
|
|
25
|
+
default: '',
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
this.authenticate = {
|
|
30
|
+
type: 'generic',
|
|
31
|
+
properties: { headers: { 'X-Api-Key': '={{$credentials.apiKey}}' } },
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.MailChannelsApi = MailChannelsApi;
|
|
36
|
+
//# sourceMappingURL=MailChannelsApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MailChannelsApi.credentials.js","sourceRoot":"","sources":["../../credentials/MailChannelsApi.credentials.ts"],"names":[],"mappings":";;;AAQA,MAAa,eAAe;IAA5B;QACC,SAAI,GAAS,EAAE,KAAK,EAAE,uBAAuB,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC;QAC/E,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,oCAAoC;gBAC7C,GAAG,EAAE,QAAQ;gBACb,MAAM,EAAE,KAAK;gBACb,qBAAqB,EAAE,IAAI;gBAC3B,OAAO,EAAE,KAAK;aACd;SACD,CAAC;QACF,SAAI,GAAG,iBAAiB,CAAC;QACzB,gBAAW,GAAG,kBAAkB,CAAC;QACjC,qBAAgB,GAAG,kDAAkD,CAAC;QACtE,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;aACd;SACD,CAAC;QACF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,0BAA0B,EAAE,EAAE;SACpE,CAAC;IACH,CAAC;CAAA;AA5BD,0CA4BC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
2
|
+
<rect width="64" height="64" rx="14" fill="#059669"/>
|
|
3
|
+
<text x="32" y="32" dy="0.35em" text-anchor="middle" font-family="ui-sans-serif, system-ui, -apple-system, sans-serif" font-size="26" font-weight="600" fill="#ffffff">VG</text>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class MailChannels implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MailChannels = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const MAX_REQUEST_BYTES = 30000000;
|
|
6
|
+
class MailChannels {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.description = {
|
|
9
|
+
usableAsTool: undefined,
|
|
10
|
+
icon: { light: 'file:mailchannels.svg', dark: 'file:mailchannels.svg' },
|
|
11
|
+
subtitle: '={{$parameter.operation}}',
|
|
12
|
+
displayName: 'MailChannels',
|
|
13
|
+
name: 'mailChannels',
|
|
14
|
+
group: ['output'],
|
|
15
|
+
version: 1,
|
|
16
|
+
description: 'Validate or send email using MailChannels',
|
|
17
|
+
defaults: { name: 'MailChannels' },
|
|
18
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
19
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
20
|
+
credentials: [{ name: 'mailChannelsApi', required: true }],
|
|
21
|
+
properties: [
|
|
22
|
+
{
|
|
23
|
+
displayName: 'Resource',
|
|
24
|
+
name: 'resource',
|
|
25
|
+
type: 'options',
|
|
26
|
+
noDataExpression: true,
|
|
27
|
+
options: [{ name: 'Email', value: 'email' }],
|
|
28
|
+
default: 'email',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
displayName: 'Operation',
|
|
32
|
+
name: 'operation',
|
|
33
|
+
type: 'options',
|
|
34
|
+
noDataExpression: true,
|
|
35
|
+
options: [
|
|
36
|
+
{
|
|
37
|
+
name: 'Send',
|
|
38
|
+
value: 'send',
|
|
39
|
+
action: 'Send an email',
|
|
40
|
+
description: 'Submit email for delivery',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'Validate',
|
|
44
|
+
value: 'validate',
|
|
45
|
+
action: 'Validate an email',
|
|
46
|
+
description: 'Validate without sending email',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
default: 'validate',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
displayName: 'Input Mode',
|
|
53
|
+
name: 'inputMode',
|
|
54
|
+
type: 'options',
|
|
55
|
+
noDataExpression: true,
|
|
56
|
+
default: 'json',
|
|
57
|
+
options: [
|
|
58
|
+
{ name: 'Fields', value: 'fields' },
|
|
59
|
+
{ name: 'JSON', value: 'json' },
|
|
60
|
+
],
|
|
61
|
+
description: 'Use fields for a single message or JSON for advanced options. Both drafts stay editable; only the selected mode is sent.',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
displayName: 'From Email',
|
|
65
|
+
name: 'fromEmail',
|
|
66
|
+
type: 'string',
|
|
67
|
+
default: '',
|
|
68
|
+
required: true,
|
|
69
|
+
displayOptions: { show: { inputMode: ['fields'] } },
|
|
70
|
+
placeholder: 'sender@example.com',
|
|
71
|
+
description: 'Sender email address without a display name',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
displayName: 'From Email',
|
|
75
|
+
name: 'fromEmail',
|
|
76
|
+
type: 'string',
|
|
77
|
+
default: '',
|
|
78
|
+
displayOptions: { show: { inputMode: ['json'] } },
|
|
79
|
+
placeholder: 'sender@example.com',
|
|
80
|
+
description: 'Sender email address without a display name',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
displayName: 'To Emails',
|
|
84
|
+
name: 'toEmails',
|
|
85
|
+
type: 'string',
|
|
86
|
+
default: '',
|
|
87
|
+
required: true,
|
|
88
|
+
displayOptions: { show: { inputMode: ['fields'] } },
|
|
89
|
+
placeholder: 'recipient@example.com',
|
|
90
|
+
description: 'Comma-separated email addresses without display names',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
displayName: 'To Emails',
|
|
94
|
+
name: 'toEmails',
|
|
95
|
+
type: 'string',
|
|
96
|
+
default: '',
|
|
97
|
+
displayOptions: { show: { inputMode: ['json'] } },
|
|
98
|
+
placeholder: 'recipient@example.com',
|
|
99
|
+
description: 'Comma-separated email addresses without display names',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
displayName: 'Subject',
|
|
103
|
+
name: 'subject',
|
|
104
|
+
type: 'string',
|
|
105
|
+
default: '',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
displayName: 'Email Format',
|
|
109
|
+
name: 'emailFormat',
|
|
110
|
+
type: 'options',
|
|
111
|
+
default: 'text',
|
|
112
|
+
options: [
|
|
113
|
+
{ name: 'HTML', value: 'html' },
|
|
114
|
+
{ name: 'Text', value: 'text' },
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
displayName: 'Message',
|
|
119
|
+
name: 'message',
|
|
120
|
+
type: 'string',
|
|
121
|
+
default: '',
|
|
122
|
+
required: true,
|
|
123
|
+
typeOptions: { rows: 5 },
|
|
124
|
+
displayOptions: { show: { inputMode: ['fields'] } },
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
displayName: 'Message',
|
|
128
|
+
name: 'message',
|
|
129
|
+
type: 'string',
|
|
130
|
+
default: '',
|
|
131
|
+
typeOptions: { rows: 5 },
|
|
132
|
+
displayOptions: { show: { inputMode: ['json'] } },
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
displayName: 'Options',
|
|
136
|
+
name: 'emailOptions',
|
|
137
|
+
type: 'collection',
|
|
138
|
+
default: {},
|
|
139
|
+
placeholder: 'Add Option',
|
|
140
|
+
options: [
|
|
141
|
+
{
|
|
142
|
+
displayName: 'BCC Emails',
|
|
143
|
+
name: 'bcc',
|
|
144
|
+
type: 'string',
|
|
145
|
+
default: '',
|
|
146
|
+
description: 'Comma-separated email addresses without display names',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
displayName: 'CC Emails',
|
|
150
|
+
name: 'cc',
|
|
151
|
+
type: 'string',
|
|
152
|
+
default: '',
|
|
153
|
+
description: 'Comma-separated email addresses without display names',
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
displayName: 'Reply To Email',
|
|
157
|
+
name: 'replyTo',
|
|
158
|
+
type: 'string',
|
|
159
|
+
default: '',
|
|
160
|
+
description: 'Reply-to email address without a display name',
|
|
161
|
+
},
|
|
162
|
+
{ displayName: 'Sender Name', name: 'senderName', type: 'string', default: '' },
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
displayName: 'Email Payload',
|
|
167
|
+
name: 'payload',
|
|
168
|
+
displayOptions: { show: { inputMode: ['json'] } },
|
|
169
|
+
type: 'json',
|
|
170
|
+
required: true,
|
|
171
|
+
default: '{"from":{"email":"sender@example.com"},"personalizations":[{"to":[{"email":"recipient@example.com"}]}],"subject":"Example","content":[{"type":"text/plain","value":"Hello"}]}',
|
|
172
|
+
description: 'Email API JSON body, including To/Cc/Bcc, Reply-To and optional attachments',
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
displayName: 'Email Payload',
|
|
176
|
+
name: 'payload',
|
|
177
|
+
displayOptions: { show: { inputMode: ['fields'] } },
|
|
178
|
+
type: 'json',
|
|
179
|
+
default: '{"from":{"email":"sender@example.com"},"personalizations":[{"to":[{"email":"recipient@example.com"}]}],"subject":"Example","content":[{"type":"text/plain","value":"Hello"}]}',
|
|
180
|
+
description: 'Email API JSON body, including To/Cc/Bcc, Reply-To and optional attachments',
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
displayName: 'Attachment Binary Fields',
|
|
184
|
+
name: 'binaryFields',
|
|
185
|
+
type: 'string',
|
|
186
|
+
default: '',
|
|
187
|
+
description: 'Comma-separated incoming binary field names to append as attachments',
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
async execute() {
|
|
193
|
+
var _a, _b, _c;
|
|
194
|
+
const items = this.getInputData();
|
|
195
|
+
const output = [];
|
|
196
|
+
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
197
|
+
let dispatched = false;
|
|
198
|
+
try {
|
|
199
|
+
const operation = this.getNodeParameter('operation', itemIndex);
|
|
200
|
+
if (!['send', 'validate'].includes(operation))
|
|
201
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid operation');
|
|
202
|
+
const mode = this.getNodeParameter('inputMode', itemIndex, 'json');
|
|
203
|
+
let body;
|
|
204
|
+
if (mode === 'fields') {
|
|
205
|
+
const address = (value) => {
|
|
206
|
+
if (typeof value !== 'string' || /[\r\n]/.test(value))
|
|
207
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid address');
|
|
208
|
+
const email = value.trim();
|
|
209
|
+
if (!/^[^\s@<>,;]+@[^\s@<>,;]+$/.test(email))
|
|
210
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid address');
|
|
211
|
+
return { email };
|
|
212
|
+
};
|
|
213
|
+
const addresses = (value) => {
|
|
214
|
+
if (typeof value !== 'string')
|
|
215
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid recipients');
|
|
216
|
+
return value.split(',').map(address);
|
|
217
|
+
};
|
|
218
|
+
const options = this.getNodeParameter('emailOptions', itemIndex, {});
|
|
219
|
+
const from = address(this.getNodeParameter('fromEmail', itemIndex));
|
|
220
|
+
if (options.senderName)
|
|
221
|
+
from.name = options.senderName;
|
|
222
|
+
const personalization = {
|
|
223
|
+
to: addresses(this.getNodeParameter('toEmails', itemIndex)),
|
|
224
|
+
};
|
|
225
|
+
for (const key of ['cc', 'bcc'])
|
|
226
|
+
if (options[key])
|
|
227
|
+
personalization[key] = addresses(options[key]);
|
|
228
|
+
const format = this.getNodeParameter('emailFormat', itemIndex, 'text');
|
|
229
|
+
if (!['text', 'html'].includes(format))
|
|
230
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid format');
|
|
231
|
+
const message = this.getNodeParameter('message', itemIndex);
|
|
232
|
+
const subject = this.getNodeParameter('subject', itemIndex, '');
|
|
233
|
+
if (typeof message !== 'string' ||
|
|
234
|
+
!message.length ||
|
|
235
|
+
typeof subject !== 'string' ||
|
|
236
|
+
/[\r\n]/.test(subject))
|
|
237
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid message');
|
|
238
|
+
if (from.name !== undefined &&
|
|
239
|
+
(typeof from.name !== 'string' || /[\r\n]/.test(from.name)))
|
|
240
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid sender name');
|
|
241
|
+
body = {
|
|
242
|
+
from,
|
|
243
|
+
personalizations: [personalization],
|
|
244
|
+
subject,
|
|
245
|
+
content: [{ type: format === 'html' ? 'text/html' : 'text/plain', value: message }],
|
|
246
|
+
};
|
|
247
|
+
if (options.replyTo)
|
|
248
|
+
body.reply_to = address(options.replyTo);
|
|
249
|
+
}
|
|
250
|
+
else if (mode === 'json') {
|
|
251
|
+
const raw = this.getNodeParameter('payload', itemIndex);
|
|
252
|
+
body = (typeof raw === 'string' ? JSON.parse(raw) : structuredClone(raw));
|
|
253
|
+
}
|
|
254
|
+
else
|
|
255
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid input mode');
|
|
256
|
+
if (!body ||
|
|
257
|
+
Array.isArray(body) ||
|
|
258
|
+
typeof body !== 'object' ||
|
|
259
|
+
!body.from ||
|
|
260
|
+
!Array.isArray(body.personalizations) ||
|
|
261
|
+
!body.personalizations.length ||
|
|
262
|
+
typeof body.subject !== 'string' ||
|
|
263
|
+
!Array.isArray(body.content) ||
|
|
264
|
+
!body.content.length)
|
|
265
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid payload');
|
|
266
|
+
let requestBytes = Buffer.byteLength(JSON.stringify(body), 'utf8');
|
|
267
|
+
if (requestBytes > MAX_REQUEST_BYTES)
|
|
268
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Local request size limit exceeded');
|
|
269
|
+
const fields = this.getNodeParameter('binaryFields', itemIndex, '')
|
|
270
|
+
.split(',')
|
|
271
|
+
.map((v) => v.trim())
|
|
272
|
+
.filter(Boolean);
|
|
273
|
+
if (new Set(fields).size !== fields.length)
|
|
274
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Duplicate binary field');
|
|
275
|
+
if (body.attachments !== undefined && !Array.isArray(body.attachments))
|
|
276
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid attachments');
|
|
277
|
+
const attachments = [...((_a = body.attachments) !== null && _a !== void 0 ? _a : [])];
|
|
278
|
+
if (attachments.length + fields.length > 1000)
|
|
279
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Maximum attachment count exceeded');
|
|
280
|
+
if (fields.length) {
|
|
281
|
+
body.attachments = attachments;
|
|
282
|
+
requestBytes = Buffer.byteLength(JSON.stringify(body), 'utf8');
|
|
283
|
+
if (requestBytes > MAX_REQUEST_BYTES)
|
|
284
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Local request size limit exceeded');
|
|
285
|
+
}
|
|
286
|
+
for (const field of fields) {
|
|
287
|
+
const info = this.helpers.assertBinaryData(itemIndex, field);
|
|
288
|
+
if (!info.fileName ||
|
|
289
|
+
[...info.fileName].some((c) => c.charCodeAt(0) < 32) ||
|
|
290
|
+
!info.mimeType ||
|
|
291
|
+
[...info.mimeType].some((c) => c.charCodeAt(0) < 32))
|
|
292
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid attachment metadata');
|
|
293
|
+
const bytes = await this.helpers.getBinaryDataBuffer(itemIndex, field);
|
|
294
|
+
const attachment = { filename: info.fileName, type: info.mimeType, content: '' };
|
|
295
|
+
requestBytes +=
|
|
296
|
+
Buffer.byteLength(JSON.stringify(attachment), 'utf8') +
|
|
297
|
+
4 * Math.ceil(bytes.length / 3) +
|
|
298
|
+
(attachments.length ? 1 : 0);
|
|
299
|
+
if (requestBytes > MAX_REQUEST_BYTES)
|
|
300
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Local attachment size limit exceeded');
|
|
301
|
+
attachment.content = bytes.toString('base64');
|
|
302
|
+
attachments.push(attachment);
|
|
303
|
+
}
|
|
304
|
+
if (attachments.length)
|
|
305
|
+
body.attachments = attachments;
|
|
306
|
+
if (Buffer.byteLength(JSON.stringify(body), 'utf8') > MAX_REQUEST_BYTES)
|
|
307
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Local request size limit exceeded');
|
|
308
|
+
const credentials = await this.getCredentials('mailChannelsApi');
|
|
309
|
+
if (typeof credentials.apiKey !== 'string' || !/^[\x21-\x7e]+$/.test(credentials.apiKey))
|
|
310
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid credential');
|
|
311
|
+
dispatched = true;
|
|
312
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'mailChannelsApi', {
|
|
313
|
+
method: 'POST',
|
|
314
|
+
url: 'https://api.mailchannels.net/tx/v1/send',
|
|
315
|
+
qs: operation === 'validate' ? { 'dry-run': true } : {},
|
|
316
|
+
body,
|
|
317
|
+
json: true,
|
|
318
|
+
disableFollowRedirect: true,
|
|
319
|
+
skipSslCertificateValidation: false,
|
|
320
|
+
returnFullResponse: true,
|
|
321
|
+
timeout: 30000,
|
|
322
|
+
});
|
|
323
|
+
const expected = operation === 'validate' ? 200 : 202;
|
|
324
|
+
if (response.statusCode !== expected)
|
|
325
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Unexpected status');
|
|
326
|
+
const result = {
|
|
327
|
+
status: operation === 'validate' ? 'validated' : 'accepted',
|
|
328
|
+
statusCode: expected,
|
|
329
|
+
dryRun: operation === 'validate',
|
|
330
|
+
};
|
|
331
|
+
if (operation === 'validate' &&
|
|
332
|
+
(!Array.isArray((_b = response.body) === null || _b === void 0 ? void 0 : _b.data) ||
|
|
333
|
+
!response.body.data.every((v) => typeof v === 'string')))
|
|
334
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Unexpected validation response');
|
|
335
|
+
if (typeof ((_c = response.body) === null || _c === void 0 ? void 0 : _c.request_id) === 'string')
|
|
336
|
+
result.requestId = response.body.request_id;
|
|
337
|
+
output.push({ json: result, pairedItem: { item: itemIndex } });
|
|
338
|
+
}
|
|
339
|
+
catch {
|
|
340
|
+
const message = dispatched
|
|
341
|
+
? 'Email API request failed or acceptance is unknown. Investigate before retrying.'
|
|
342
|
+
: 'Email configuration or attachment validation failed before dispatch.';
|
|
343
|
+
if (this.continueOnFail())
|
|
344
|
+
output.push({ json: { error: message, dispatched }, pairedItem: { item: itemIndex } });
|
|
345
|
+
else
|
|
346
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), message, { itemIndex });
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
return [output];
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
exports.MailChannels = MailChannels;
|
|
353
|
+
//# sourceMappingURL=MailChannels.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MailChannels.node.js","sourceRoot":"","sources":["../../../nodes/MailChannels/MailChannels.node.ts"],"names":[],"mappings":";;;AAOA,+CAAuE;AAGvE,MAAM,iBAAiB,GAAG,QAAU,CAAC;AAGrC,MAAa,YAAY;IAAzB;QACC,gBAAW,GAAyB;YACnC,YAAY,EAAE,SAAS;YACvB,IAAI,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,IAAI,EAAE,uBAAuB,EAAE;YACvE,QAAQ,EAAE,2BAA2B;YACrC,WAAW,EAAE,cAAc;YAC3B,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,CAAC,QAAQ,CAAC;YACjB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,2CAA2C;YACxD,QAAQ,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE;YAClC,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAA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AAC;;oBACnF,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;YAC3E,CAAC;QACF,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC;CACD;AAlWD,oCAkWC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
2
|
+
<rect width="64" height="64" rx="14" fill="#059669"/>
|
|
3
|
+
<text x="32" y="32" dy="0.35em" text-anchor="middle" font-family="ui-sans-serif, system-ui, -apple-system, sans-serif" font-size="26" font-weight="600" fill="#ffffff">VG</text>
|
|
4
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,8 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailchannels/n8n-nodes-mailchannels",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "n8n community node for sending email with the MailChannels Email API",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
6
|
+
"homepage": "https://docs.mailchannels.com/email-api/overview",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"n8n-community-node-package"
|
|
9
|
+
],
|
|
10
|
+
"author": {
|
|
11
|
+
"name": "MailChannels",
|
|
12
|
+
"email": "dev@mailchannels.com"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/mailchannels/n8n-nodes-mailchannels.git"
|
|
17
|
+
},
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/mailchannels/n8n-nodes-mailchannels/issues"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "n8n-node build",
|
|
23
|
+
"build:watch": "tsc --watch",
|
|
24
|
+
"dev": "n8n-node dev",
|
|
25
|
+
"lint": "n8n-node lint",
|
|
26
|
+
"lint:fix": "n8n-node lint --fix",
|
|
27
|
+
"test": "node --test tests/contract.cjs",
|
|
28
|
+
"release": "n8n-node release",
|
|
29
|
+
"prepublishOnly": "n8n-node prerelease"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist/nodes",
|
|
33
|
+
"dist/credentials"
|
|
34
|
+
],
|
|
35
|
+
"n8n": {
|
|
36
|
+
"n8nNodesApiVersion": 1,
|
|
37
|
+
"strict": true,
|
|
38
|
+
"credentials": [
|
|
39
|
+
"dist/credentials/MailChannelsApi.credentials.js"
|
|
40
|
+
],
|
|
41
|
+
"nodes": [
|
|
42
|
+
"dist/nodes/MailChannels/MailChannels.node.js"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@n8n/node-cli": "0.54.1",
|
|
47
|
+
"eslint": "9.32.0",
|
|
48
|
+
"prettier": "3.6.2",
|
|
49
|
+
"typescript": "5.9.2"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"n8n-workflow": "*"
|
|
53
|
+
}
|
|
8
54
|
}
|