@stacksjs/email 0.57.3 โ 0.58.19
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 +4 -4
- package/dist/index.js +325 -0
- package/package.json +50 -37
- package/LICENSE.md +0 -21
- package/dist/actions/send.d.ts +0 -3
- package/dist/actions/send.mjs +0 -30
- package/dist/drivers/emailjs.d.ts +0 -4
- package/dist/drivers/emailjs.mjs +0 -17
- package/dist/drivers/index.d.ts +0 -9
- package/dist/drivers/index.mjs +0 -9
- package/dist/drivers/mailgun.d.ts +0 -4
- package/dist/drivers/mailgun.mjs +0 -15
- package/dist/drivers/mailjet.d.ts +0 -4
- package/dist/drivers/mailjet.mjs +0 -16
- package/dist/drivers/mandrill.d.ts +0 -4
- package/dist/drivers/mandrill.mjs +0 -13
- package/dist/drivers/netcore.d.ts +0 -4
- package/dist/drivers/netcore.mjs +0 -13
- package/dist/drivers/nodemailer.d.ts +0 -4
- package/dist/drivers/nodemailer.mjs +0 -17
- package/dist/drivers/postmark.d.ts +0 -4
- package/dist/drivers/postmark.mjs +0 -13
- package/dist/drivers/sendgrid.d.ts +0 -4
- package/dist/drivers/sendgrid.mjs +0 -14
- package/dist/drivers/ses.d.ts +0 -1
- package/dist/drivers/ses.mjs +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +0 -1
- package/dist/tailwind.config.d.ts +0 -34
- package/dist/tailwind.config.mjs +0 -35
- package/dist/utils/config.d.ts +0 -5
- package/dist/utils/config.mjs +0 -5
- package/dist/utils/template.html +0 -8
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Stacks Email is driver system for sending Emails.
|
|
|
9
9
|
## ๐ค Usage
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
|
|
12
|
+
bun install -d @stacksjs/email
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
You may now use it in your project:
|
|
@@ -119,7 +119,7 @@ Learn more in the docs.
|
|
|
119
119
|
## ๐งช Testing
|
|
120
120
|
|
|
121
121
|
```bash
|
|
122
|
-
|
|
122
|
+
bun test
|
|
123
123
|
```
|
|
124
124
|
|
|
125
125
|
## ๐ Changelog
|
|
@@ -138,7 +138,7 @@ For help, discussion about best practices, or any other conversation that would
|
|
|
138
138
|
|
|
139
139
|
For casual chit-chat with others using this package:
|
|
140
140
|
|
|
141
|
-
[Join the Stacks Discord Server](https://discord.
|
|
141
|
+
[Join the Stacks Discord Server](https://discord.gg/stacksjs)
|
|
142
142
|
|
|
143
143
|
## ๐๐ผ Credits
|
|
144
144
|
|
|
@@ -152,4 +152,4 @@ Many thanks to the following core technologies & people who have contributed to
|
|
|
152
152
|
|
|
153
153
|
The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information.
|
|
154
154
|
|
|
155
|
-
Made with
|
|
155
|
+
Made with ๐
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __export = (target, all) => {
|
|
4
|
+
for (var name in all)
|
|
5
|
+
__defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
set: (newValue) => all[name] = () => newValue
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// src/drivers/sendgrid.ts
|
|
14
|
+
var exports_sendgrid = {};
|
|
15
|
+
__export(exports_sendgrid, {
|
|
16
|
+
send: () => {
|
|
17
|
+
{
|
|
18
|
+
return send3;
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
Send: () => {
|
|
22
|
+
{
|
|
23
|
+
return send3;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
import {SendgridEmailProvider} from "@novu/sendgrid";
|
|
28
|
+
import {notification as notification2} from "@stacksjs/config";
|
|
29
|
+
|
|
30
|
+
// src/send.ts
|
|
31
|
+
import {italic, log} from "@stacksjs/cli";
|
|
32
|
+
import {ResultAsync} from "@stacksjs/error-handling";
|
|
33
|
+
import * as Maizzle from "@maizzle/framework";
|
|
34
|
+
import {stringify} from "json5";
|
|
35
|
+
|
|
36
|
+
// src/tailwind.config.ts
|
|
37
|
+
var config = {
|
|
38
|
+
theme: {
|
|
39
|
+
screens: {
|
|
40
|
+
sm: "480px",
|
|
41
|
+
md: "768px",
|
|
42
|
+
lg: "976px",
|
|
43
|
+
xl: "1440px"
|
|
44
|
+
},
|
|
45
|
+
colors: {
|
|
46
|
+
blue: "#1fb6ff",
|
|
47
|
+
purple: "#7e5bef",
|
|
48
|
+
pink: "#ff49db",
|
|
49
|
+
orange: "#ff7849",
|
|
50
|
+
green: "#13ce66",
|
|
51
|
+
yellow: "#ffc82c",
|
|
52
|
+
"gray-dark": "#273444",
|
|
53
|
+
gray: "#8492a6",
|
|
54
|
+
"gray-light": "#d3dce6"
|
|
55
|
+
},
|
|
56
|
+
fontFamily: {
|
|
57
|
+
sans: ["Graphik", "sans-serif"],
|
|
58
|
+
serif: ["Merriweather", "serif"]
|
|
59
|
+
},
|
|
60
|
+
extend: {
|
|
61
|
+
spacing: {
|
|
62
|
+
128: "32rem",
|
|
63
|
+
144: "36rem"
|
|
64
|
+
},
|
|
65
|
+
borderRadius: {
|
|
66
|
+
"4xl": "2rem"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// src/utils/config.ts
|
|
73
|
+
var exports_config = {};
|
|
74
|
+
__export(exports_config, {
|
|
75
|
+
email: () => {
|
|
76
|
+
{
|
|
77
|
+
return email;
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
default: () => {
|
|
81
|
+
{
|
|
82
|
+
return config_default;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
import {notification} from "@stacksjs/config";
|
|
87
|
+
var email = notification.email;
|
|
88
|
+
var config_default = {
|
|
89
|
+
email
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// src/send.ts
|
|
93
|
+
async function send(options, provider, providerName, css) {
|
|
94
|
+
const template = `
|
|
95
|
+
<extends src="./src/notifications/src/utils/template.html">
|
|
96
|
+
<block name="template">
|
|
97
|
+
${options.html}
|
|
98
|
+
</block>
|
|
99
|
+
</extends>`;
|
|
100
|
+
await Maizzle.render(template, {
|
|
101
|
+
tailwind: {
|
|
102
|
+
config: stringify(config),
|
|
103
|
+
css,
|
|
104
|
+
maizzle: exports_config
|
|
105
|
+
}
|
|
106
|
+
}).then(({ html }) => {
|
|
107
|
+
options.html = html;
|
|
108
|
+
}).catch((error) => log.error(`Failed to render email template using provider: ${italic(providerName)}.`, error));
|
|
109
|
+
return ResultAsync.fromPromise(provider.sendMessage(options), () => new Error(`Failed to send message using provider: ${italic(providerName)}`));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// src/drivers/sendgrid.ts
|
|
113
|
+
async function send3(options, css) {
|
|
114
|
+
return send(options, driver, "Sendgrid", css);
|
|
115
|
+
}
|
|
116
|
+
var env = notification2.email;
|
|
117
|
+
var service = notification2.email?.drivers.sendgrid;
|
|
118
|
+
var driver = new SendgridEmailProvider({
|
|
119
|
+
apiKey: service?.key || "",
|
|
120
|
+
from: env?.from.address || "",
|
|
121
|
+
senderName: service?.senderName || ""
|
|
122
|
+
});
|
|
123
|
+
// src/drivers/mailgun.ts
|
|
124
|
+
var exports_mailgun = {};
|
|
125
|
+
__export(exports_mailgun, {
|
|
126
|
+
send: () => {
|
|
127
|
+
{
|
|
128
|
+
return send5;
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
Send: () => {
|
|
132
|
+
{
|
|
133
|
+
return send5;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
import {MailgunEmailProvider} from "@novu/mailgun";
|
|
138
|
+
import {notification as notification3} from "@stacksjs/config";
|
|
139
|
+
async function send5(options, css) {
|
|
140
|
+
return send(options, provider, "Mailgun", css);
|
|
141
|
+
}
|
|
142
|
+
var env2 = notification3.email;
|
|
143
|
+
var service2 = notification3.email?.drivers.mailgun;
|
|
144
|
+
var provider = new MailgunEmailProvider({
|
|
145
|
+
apiKey: service2?.key || "",
|
|
146
|
+
domain: service2?.domain || "",
|
|
147
|
+
username: service2?.username || "",
|
|
148
|
+
from: env2?.from.address || ""
|
|
149
|
+
});
|
|
150
|
+
// src/drivers/mailjet.ts
|
|
151
|
+
var exports_mailjet = {};
|
|
152
|
+
__export(exports_mailjet, {
|
|
153
|
+
send: () => {
|
|
154
|
+
{
|
|
155
|
+
return send7;
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
Send: () => {
|
|
159
|
+
{
|
|
160
|
+
return send7;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
import {MailjetEmailProvider} from "@novu/mailjet";
|
|
165
|
+
import {notification as notification4} from "@stacksjs/config";
|
|
166
|
+
async function send7(options, css) {
|
|
167
|
+
return send(options, provider2, "Mailjet", css);
|
|
168
|
+
}
|
|
169
|
+
var env3 = notification4.email;
|
|
170
|
+
var service3 = notification4.email?.drivers.mailjet;
|
|
171
|
+
var provider2 = new MailjetEmailProvider({
|
|
172
|
+
apiKey: service3?.key || "",
|
|
173
|
+
apiSecret: service3?.secret || "",
|
|
174
|
+
from: env3?.from.address || "",
|
|
175
|
+
senderName: env3?.from.name || ""
|
|
176
|
+
});
|
|
177
|
+
// src/drivers/mandrill.ts
|
|
178
|
+
var exports_mandrill = {};
|
|
179
|
+
// src/drivers/netcore.ts
|
|
180
|
+
var exports_netcore = {};
|
|
181
|
+
__export(exports_netcore, {
|
|
182
|
+
send: () => {
|
|
183
|
+
{
|
|
184
|
+
return send9;
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
Send: () => {
|
|
188
|
+
{
|
|
189
|
+
return send9;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
import {NetCoreProvider} from "@novu/netcore";
|
|
194
|
+
import {notification as notification5} from "@stacksjs/config";
|
|
195
|
+
async function send9(options, css) {
|
|
196
|
+
return send(options, provider3, "Netcore", css);
|
|
197
|
+
}
|
|
198
|
+
var env4 = notification5.email;
|
|
199
|
+
var service4 = notification5.email?.drivers.netcore;
|
|
200
|
+
var provider3 = new NetCoreProvider({
|
|
201
|
+
apiKey: service4?.key || "",
|
|
202
|
+
from: env4?.from.address || ""
|
|
203
|
+
});
|
|
204
|
+
// src/drivers/nodemailer.ts
|
|
205
|
+
var exports_nodemailer = {};
|
|
206
|
+
__export(exports_nodemailer, {
|
|
207
|
+
send: () => {
|
|
208
|
+
{
|
|
209
|
+
return send11;
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
Send: () => {
|
|
213
|
+
{
|
|
214
|
+
return send11;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
import {NodemailerProvider} from "@novu/nodemailer";
|
|
219
|
+
import {notification as notification6} from "@stacksjs/config";
|
|
220
|
+
async function send11(options, css) {
|
|
221
|
+
return send(options, provider4, "Nodemailer", css);
|
|
222
|
+
}
|
|
223
|
+
var env5 = notification6.email;
|
|
224
|
+
var service5 = notification6.email?.drivers.nodemailer;
|
|
225
|
+
var provider4 = new NodemailerProvider({
|
|
226
|
+
from: env5?.from.address || "",
|
|
227
|
+
host: service5?.host || "",
|
|
228
|
+
user: service5?.user,
|
|
229
|
+
password: service5?.password,
|
|
230
|
+
port: service5?.port || 587,
|
|
231
|
+
secure: service5?.secure
|
|
232
|
+
});
|
|
233
|
+
// src/drivers/postmark.ts
|
|
234
|
+
var exports_postmark = {};
|
|
235
|
+
__export(exports_postmark, {
|
|
236
|
+
send: () => {
|
|
237
|
+
{
|
|
238
|
+
return send13;
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
Send: () => {
|
|
242
|
+
{
|
|
243
|
+
return send13;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
import {PostmarkEmailProvider} from "@novu/postmark";
|
|
248
|
+
import {notification as notification7} from "@stacksjs/config";
|
|
249
|
+
async function send13(options, css) {
|
|
250
|
+
return send(options, provider5, "Postmark", css);
|
|
251
|
+
}
|
|
252
|
+
var env6 = notification7.email;
|
|
253
|
+
var service6 = notification7.email?.drivers.postmark;
|
|
254
|
+
var provider5 = new PostmarkEmailProvider({
|
|
255
|
+
apiKey: service6?.key || "",
|
|
256
|
+
from: env6?.from.address || ""
|
|
257
|
+
});
|
|
258
|
+
// src/drivers/ses.ts
|
|
259
|
+
var exports_ses = {};
|
|
260
|
+
__export(exports_ses, {
|
|
261
|
+
send: () => {
|
|
262
|
+
{
|
|
263
|
+
return send14;
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
Send: () => {
|
|
267
|
+
{
|
|
268
|
+
return send14;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
import {SESEmailProvider} from "@novu/ses";
|
|
273
|
+
import {notification as notification8} from "@stacksjs/config";
|
|
274
|
+
async function send14(options, css) {
|
|
275
|
+
return sendEmail(options, provider6, "Ses", css);
|
|
276
|
+
}
|
|
277
|
+
var email2 = notification8.email;
|
|
278
|
+
var env7 = email2?.drivers?.ses;
|
|
279
|
+
var provider6 = new SESEmailProvider({
|
|
280
|
+
region: env7?.region || "us-east-1",
|
|
281
|
+
accessKeyId: env7?.key || "",
|
|
282
|
+
secretAccessKey: env7?.secret || "",
|
|
283
|
+
senderName: email2?.from.name || "Stacks",
|
|
284
|
+
from: email2?.from.address || ""
|
|
285
|
+
});
|
|
286
|
+
// src/drivers/emailjs.ts
|
|
287
|
+
var exports_emailjs = {};
|
|
288
|
+
__export(exports_emailjs, {
|
|
289
|
+
send: () => {
|
|
290
|
+
{
|
|
291
|
+
return send16;
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
Send: () => {
|
|
295
|
+
{
|
|
296
|
+
return send16;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
import {EmailJsProvider} from "@novu/emailjs";
|
|
301
|
+
import {notification as notification9} from "@stacksjs/config";
|
|
302
|
+
async function send16(options, css) {
|
|
303
|
+
return send(options, provider7, "EmailJS", css);
|
|
304
|
+
}
|
|
305
|
+
var env8 = notification9.email;
|
|
306
|
+
var service7 = notification9.email?.drivers.emailjs;
|
|
307
|
+
var provider7 = new EmailJsProvider({
|
|
308
|
+
from: env8?.from.address || "",
|
|
309
|
+
host: service7?.host || "",
|
|
310
|
+
user: service7?.user,
|
|
311
|
+
password: service7?.password,
|
|
312
|
+
port: service7?.port || 587,
|
|
313
|
+
secure: service7?.secure
|
|
314
|
+
});
|
|
315
|
+
export {
|
|
316
|
+
exports_ses as ses,
|
|
317
|
+
exports_sendgrid as sendgrid,
|
|
318
|
+
exports_postmark as postmark,
|
|
319
|
+
exports_nodemailer as nodemailer,
|
|
320
|
+
exports_netcore as netcore,
|
|
321
|
+
exports_mandrill as mandrill,
|
|
322
|
+
exports_mailjet as mailjet,
|
|
323
|
+
exports_mailgun as mailgun,
|
|
324
|
+
exports_emailjs as emailjs
|
|
325
|
+
};
|
package/package.json
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/email",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@8.6.6",
|
|
4
|
+
"version": "0.58.19",
|
|
6
5
|
"description": "The Stacks Email integration. Painlessly create & manage your inboxes, templates, and send emails.",
|
|
7
6
|
"author": "Chris Breuer",
|
|
8
7
|
"license": "MIT",
|
|
9
8
|
"funding": "https://github.com/sponsors/chrisbbreuer",
|
|
10
|
-
"homepage": "https://github.com/stacksjs/stacks/tree/main
|
|
9
|
+
"homepage": "https://github.com/stacksjs/stacks/tree/main/storage/framework/core/src/email#readme",
|
|
11
10
|
"repository": {
|
|
12
11
|
"type": "git",
|
|
13
12
|
"url": "git+https://github.com/stacksjs/stacks.git",
|
|
14
|
-
"directory": "
|
|
13
|
+
"directory": "./storage/framework/core/src/email"
|
|
15
14
|
},
|
|
16
15
|
"bugs": {
|
|
17
16
|
"url": "https://github.com/stacksjs/stacks/issues"
|
|
@@ -33,49 +32,63 @@
|
|
|
33
32
|
],
|
|
34
33
|
"exports": {
|
|
35
34
|
".": {
|
|
36
|
-
"
|
|
37
|
-
"import": "./dist/index.
|
|
35
|
+
"bun": "./src/index.ts",
|
|
36
|
+
"import": "./dist/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./*": {
|
|
39
|
+
"bun": "./src/*",
|
|
40
|
+
"import": "./dist/*"
|
|
38
41
|
}
|
|
39
42
|
},
|
|
40
|
-
"module": "dist/index.
|
|
43
|
+
"module": "dist/index.js",
|
|
41
44
|
"types": "dist/index.d.ts",
|
|
42
45
|
"contributors": [
|
|
43
|
-
"Chris Breuer <chris@
|
|
46
|
+
"Chris Breuer <chris@stacksjs.org>"
|
|
44
47
|
],
|
|
45
48
|
"files": [
|
|
46
|
-
"
|
|
47
|
-
"
|
|
49
|
+
"README.md",
|
|
50
|
+
"dist"
|
|
48
51
|
],
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "bun --bun build.ts",
|
|
54
|
+
"build:inbound": "bun --bun build-inbound.ts",
|
|
55
|
+
"typecheck": "bun --bun tsc --noEmit",
|
|
56
|
+
"prepublishOnly": "bun --bun run build"
|
|
57
|
+
},
|
|
49
58
|
"peerDependencies": {
|
|
50
|
-
"@maizzle/framework": "^4.
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@novu/netcore": "^0.16.2",
|
|
56
|
-
"@novu/node": "^0.16.2",
|
|
57
|
-
"@novu/nodemailer": "^0.16.2",
|
|
58
|
-
"@novu/postmark": "^0.16.2",
|
|
59
|
-
"@novu/sendgrid": "^0.16.2",
|
|
60
|
-
"@novu/ses": "^0.16.2",
|
|
61
|
-
"@novu/stateless": "^0.16.2",
|
|
62
|
-
"@stacksjs/cli": "0.57.3",
|
|
63
|
-
"@stacksjs/config": "0.57.3",
|
|
64
|
-
"@stacksjs/error-handling": "0.57.3",
|
|
65
|
-
"@stacksjs/types": "0.57.3"
|
|
59
|
+
"@maizzle/framework": "^4.6.5",
|
|
60
|
+
"@stacksjs/cli": "workspace:*",
|
|
61
|
+
"@stacksjs/config": "workspace:*",
|
|
62
|
+
"@stacksjs/error-handling": "workspace:*",
|
|
63
|
+
"@stacksjs/types": "workspace:*"
|
|
66
64
|
},
|
|
67
65
|
"dependencies": {
|
|
68
|
-
"@
|
|
69
|
-
"@
|
|
70
|
-
"@stacksjs/
|
|
66
|
+
"@maizzle/framework": "^4.6.5",
|
|
67
|
+
"@novu/stateless": "^0.22.0",
|
|
68
|
+
"@stacksjs/cli": "workspace:*",
|
|
69
|
+
"@stacksjs/config": "workspace:*",
|
|
70
|
+
"@stacksjs/error-handling": "workspace:*",
|
|
71
|
+
"@stacksjs/types": "workspace:*",
|
|
72
|
+
"@types/mailparser": "^3.4.4",
|
|
73
|
+
"mailparser": "^3.6.6",
|
|
74
|
+
"mime": "^4.0.1",
|
|
75
|
+
"moment": "^2.30.1",
|
|
76
|
+
"nodemailer": "^6.9.8",
|
|
77
|
+
"uuid": "^9.0.1"
|
|
71
78
|
},
|
|
72
|
-
"
|
|
73
|
-
"@
|
|
74
|
-
"@
|
|
79
|
+
"optionalDependencies": {
|
|
80
|
+
"@novu/emailjs": "^0.22.0",
|
|
81
|
+
"@novu/mailgun": "^0.22.0",
|
|
82
|
+
"@novu/mailjet": "^0.22.0",
|
|
83
|
+
"@novu/mandrill": "^0.22.0",
|
|
84
|
+
"@novu/netcore": "^0.22.0",
|
|
85
|
+
"@novu/node": "^0.22.0",
|
|
86
|
+
"@novu/nodemailer": "^0.22.0",
|
|
87
|
+
"@novu/postmark": "^0.22.0",
|
|
88
|
+
"@novu/sendgrid": "^0.22.0",
|
|
89
|
+
"@novu/ses": "^0.22.0"
|
|
75
90
|
},
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"dev": "unbuild --stub",
|
|
79
|
-
"typecheck": "tsc --noEmit"
|
|
91
|
+
"devDependencies": {
|
|
92
|
+
"@stacksjs/development": "workspace:*"
|
|
80
93
|
}
|
|
81
|
-
}
|
|
94
|
+
}
|
package/LICENSE.md
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 Open Web Foundation
|
|
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/dist/actions/send.d.ts
DELETED
package/dist/actions/send.mjs
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { italic } from "@stacksjs/cli";
|
|
2
|
-
import { log } from "@stacksjs/logging";
|
|
3
|
-
import { ResultAsync } from "@stacksjs/error-handling";
|
|
4
|
-
import * as Maizzle from "@maizzle/framework";
|
|
5
|
-
import * as maizzleConfig from "../utils/config.mjs";
|
|
6
|
-
import { config } from "../tailwind.config.mjs";
|
|
7
|
-
export async function send(options, provider, providerName, css) {
|
|
8
|
-
const template = `
|
|
9
|
-
<extends src="./core/notifications/src/utils/template.html">
|
|
10
|
-
<block name="template">
|
|
11
|
-
${options.html}
|
|
12
|
-
</block>
|
|
13
|
-
</extends>`;
|
|
14
|
-
await Maizzle.render(
|
|
15
|
-
template,
|
|
16
|
-
{
|
|
17
|
-
tailwind: {
|
|
18
|
-
config,
|
|
19
|
-
css,
|
|
20
|
-
maizzle: maizzleConfig
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
).then(({ html }) => {
|
|
24
|
-
options.html = html;
|
|
25
|
-
}).catch((error) => log.error(`Failed to render email template using provider: ${italic(providerName)}.`, error));
|
|
26
|
-
return ResultAsync.fromPromise(
|
|
27
|
-
provider.sendMessage(options),
|
|
28
|
-
() => new Error(`Failed to send message using provider: ${italic(providerName)}`)
|
|
29
|
-
);
|
|
30
|
-
}
|
package/dist/drivers/emailjs.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { EmailJsProvider } from "@novu/emailjs";
|
|
2
|
-
import { notification } from "@stacksjs/config";
|
|
3
|
-
import { send as sendEmail } from "../actions/send.mjs";
|
|
4
|
-
const env = notification.email;
|
|
5
|
-
const service = notification.email?.drivers.emailjs;
|
|
6
|
-
const provider = new EmailJsProvider({
|
|
7
|
-
from: env?.from.address || "",
|
|
8
|
-
host: service?.host || "",
|
|
9
|
-
user: service?.user,
|
|
10
|
-
password: service?.password,
|
|
11
|
-
port: service?.port || 587,
|
|
12
|
-
secure: service?.secure
|
|
13
|
-
});
|
|
14
|
-
async function send(options, css) {
|
|
15
|
-
return sendEmail(options, provider, "EmailJS", css);
|
|
16
|
-
}
|
|
17
|
-
export { send as Send, send };
|
package/dist/drivers/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * as sendgrid from './sendgrid';
|
|
2
|
-
export * as mailgun from './mailgun';
|
|
3
|
-
export * as mailjet from './mailjet';
|
|
4
|
-
export * as mandrill from './mandrill';
|
|
5
|
-
export * as netcore from './netcore';
|
|
6
|
-
export * as nodemailer from './nodemailer';
|
|
7
|
-
export * as postmark from './postmark';
|
|
8
|
-
export * as ses from './ses';
|
|
9
|
-
export * as emailjs from './emailjs';
|
package/dist/drivers/index.mjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * as sendgrid from "./sendgrid.mjs";
|
|
2
|
-
export * as mailgun from "./mailgun.mjs";
|
|
3
|
-
export * as mailjet from "./mailjet.mjs";
|
|
4
|
-
export * as mandrill from "./mandrill.mjs";
|
|
5
|
-
export * as netcore from "./netcore.mjs";
|
|
6
|
-
export * as nodemailer from "./nodemailer.mjs";
|
|
7
|
-
export * as postmark from "./postmark.mjs";
|
|
8
|
-
export * as ses from "./ses.mjs";
|
|
9
|
-
export * as emailjs from "./emailjs.mjs";
|
package/dist/drivers/mailgun.mjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { MailgunEmailProvider } from "@novu/mailgun";
|
|
2
|
-
import { notification } from "@stacksjs/config";
|
|
3
|
-
import { send as sendEmail } from "../actions/send.mjs";
|
|
4
|
-
const env = notification.email;
|
|
5
|
-
const service = notification.email?.drivers.mailgun;
|
|
6
|
-
const provider = new MailgunEmailProvider({
|
|
7
|
-
apiKey: service?.key || "",
|
|
8
|
-
domain: service?.domain || "",
|
|
9
|
-
username: service?.username || "",
|
|
10
|
-
from: env?.from.address || ""
|
|
11
|
-
});
|
|
12
|
-
async function send(options, css) {
|
|
13
|
-
return sendEmail(options, provider, "Mailgun", css);
|
|
14
|
-
}
|
|
15
|
-
export { send as Send, send };
|
package/dist/drivers/mailjet.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { MailjetEmailProvider } from "@novu/mailjet";
|
|
2
|
-
import { notification } from "@stacksjs/config";
|
|
3
|
-
import { send as sendEmail } from "../actions/send.mjs";
|
|
4
|
-
const env = notification.email;
|
|
5
|
-
const service = notification.email?.drivers.mailjet;
|
|
6
|
-
const provider = new MailjetEmailProvider({
|
|
7
|
-
apiKey: service?.key || "",
|
|
8
|
-
apiSecret: service?.secret || "",
|
|
9
|
-
from: env?.from.address || "",
|
|
10
|
-
senderName: env?.from.name || ""
|
|
11
|
-
// look into what exactly this stands for
|
|
12
|
-
});
|
|
13
|
-
async function send(options, css) {
|
|
14
|
-
return sendEmail(options, provider, "Mailjet", css);
|
|
15
|
-
}
|
|
16
|
-
export { send as Send, send };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { MandrillProvider } from "@novu/mandrill";
|
|
2
|
-
import { notification } from "@stacksjs/config";
|
|
3
|
-
import { send as sendEmail } from "../actions/send.mjs";
|
|
4
|
-
const env = notification.email;
|
|
5
|
-
const service = notification.email?.drivers.mandrill;
|
|
6
|
-
const provider = new MandrillProvider({
|
|
7
|
-
apiKey: service?.key || "",
|
|
8
|
-
from: env?.from.address || ""
|
|
9
|
-
});
|
|
10
|
-
async function send(options, css) {
|
|
11
|
-
return sendEmail(options, provider, "Mandrill", css);
|
|
12
|
-
}
|
|
13
|
-
export { send as Send, send };
|
package/dist/drivers/netcore.mjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { NetCoreProvider } from "@novu/netcore";
|
|
2
|
-
import { notification } from "@stacksjs/config";
|
|
3
|
-
import { send as sendEmail } from "../actions/send.mjs";
|
|
4
|
-
const env = notification.email;
|
|
5
|
-
const service = notification.email?.drivers.netcore;
|
|
6
|
-
const provider = new NetCoreProvider({
|
|
7
|
-
apiKey: service?.key || "",
|
|
8
|
-
from: env?.from.address || ""
|
|
9
|
-
});
|
|
10
|
-
async function send(options, css) {
|
|
11
|
-
return sendEmail(options, provider, "Netcore", css);
|
|
12
|
-
}
|
|
13
|
-
export { send as Send, send };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { NodemailerProvider } from "@novu/nodemailer";
|
|
2
|
-
import { notification } from "@stacksjs/config";
|
|
3
|
-
import { send as sendEmail } from "../actions/send.mjs";
|
|
4
|
-
const env = notification.email;
|
|
5
|
-
const service = notification.email?.drivers.nodemailer;
|
|
6
|
-
const provider = new NodemailerProvider({
|
|
7
|
-
from: env?.from.address || "",
|
|
8
|
-
host: service?.host || "",
|
|
9
|
-
user: service?.user,
|
|
10
|
-
password: service?.password,
|
|
11
|
-
port: service?.port || 587,
|
|
12
|
-
secure: service?.secure
|
|
13
|
-
});
|
|
14
|
-
async function send(options, css) {
|
|
15
|
-
return sendEmail(options, provider, "Nodemailer", css);
|
|
16
|
-
}
|
|
17
|
-
export { send as Send, send };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { PostmarkEmailProvider } from "@novu/postmark";
|
|
2
|
-
import { notification } from "@stacksjs/config";
|
|
3
|
-
import { send as sendEmail } from "../actions/send.mjs";
|
|
4
|
-
const env = notification.email;
|
|
5
|
-
const service = notification.email?.drivers.postmark;
|
|
6
|
-
const provider = new PostmarkEmailProvider({
|
|
7
|
-
apiKey: service?.key || "",
|
|
8
|
-
from: env?.from.address || ""
|
|
9
|
-
});
|
|
10
|
-
async function send(options, css) {
|
|
11
|
-
return sendEmail(options, provider, "Postmark", css);
|
|
12
|
-
}
|
|
13
|
-
export { send as Send, send };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { SendgridEmailProvider } from "@novu/sendgrid";
|
|
2
|
-
import { notification } from "@stacksjs/config";
|
|
3
|
-
import { send as sendEmail } from "../actions/send.mjs";
|
|
4
|
-
const env = notification.email;
|
|
5
|
-
const service = notification.email?.drivers.sendgrid;
|
|
6
|
-
const driver = new SendgridEmailProvider({
|
|
7
|
-
apiKey: service?.key || "",
|
|
8
|
-
from: env?.from.address || "",
|
|
9
|
-
senderName: service?.senderName || ""
|
|
10
|
-
});
|
|
11
|
-
async function send(options, css) {
|
|
12
|
-
return sendEmail(options, driver, "Sendgrid", css);
|
|
13
|
-
}
|
|
14
|
-
export { send as Send, send };
|
package/dist/drivers/ses.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/drivers/ses.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './drivers';
|
package/dist/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./drivers/index.mjs";
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export declare const config: {
|
|
2
|
-
theme: {
|
|
3
|
-
screens: {
|
|
4
|
-
sm: string;
|
|
5
|
-
md: string;
|
|
6
|
-
lg: string;
|
|
7
|
-
xl: string;
|
|
8
|
-
};
|
|
9
|
-
colors: {
|
|
10
|
-
blue: string;
|
|
11
|
-
purple: string;
|
|
12
|
-
pink: string;
|
|
13
|
-
orange: string;
|
|
14
|
-
green: string;
|
|
15
|
-
yellow: string;
|
|
16
|
-
'gray-dark': string;
|
|
17
|
-
gray: string;
|
|
18
|
-
'gray-light': string;
|
|
19
|
-
};
|
|
20
|
-
fontFamily: {
|
|
21
|
-
sans: string[];
|
|
22
|
-
serif: string[];
|
|
23
|
-
};
|
|
24
|
-
extend: {
|
|
25
|
-
spacing: {
|
|
26
|
-
128: string;
|
|
27
|
-
144: string;
|
|
28
|
-
};
|
|
29
|
-
borderRadius: {
|
|
30
|
-
'4xl': string;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
};
|
package/dist/tailwind.config.mjs
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export const config = {
|
|
2
|
-
// ...email?.build,
|
|
3
|
-
theme: {
|
|
4
|
-
screens: {
|
|
5
|
-
sm: "480px",
|
|
6
|
-
md: "768px",
|
|
7
|
-
lg: "976px",
|
|
8
|
-
xl: "1440px"
|
|
9
|
-
},
|
|
10
|
-
colors: {
|
|
11
|
-
"blue": "#1fb6ff",
|
|
12
|
-
"purple": "#7e5bef",
|
|
13
|
-
"pink": "#ff49db",
|
|
14
|
-
"orange": "#ff7849",
|
|
15
|
-
"green": "#13ce66",
|
|
16
|
-
"yellow": "#ffc82c",
|
|
17
|
-
"gray-dark": "#273444",
|
|
18
|
-
"gray": "#8492a6",
|
|
19
|
-
"gray-light": "#d3dce6"
|
|
20
|
-
},
|
|
21
|
-
fontFamily: {
|
|
22
|
-
sans: ["Graphik", "sans-serif"],
|
|
23
|
-
serif: ["Merriweather", "serif"]
|
|
24
|
-
},
|
|
25
|
-
extend: {
|
|
26
|
-
spacing: {
|
|
27
|
-
128: "32rem",
|
|
28
|
-
144: "36rem"
|
|
29
|
-
},
|
|
30
|
-
borderRadius: {
|
|
31
|
-
"4xl": "2rem"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
};
|
package/dist/utils/config.d.ts
DELETED
package/dist/utils/config.mjs
DELETED