@stacksjs/email 0.47.2 → 0.48.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 CHANGED
@@ -1,60 +1,118 @@
1
- # Stacks Notifications
1
+ # Stacks SMS
2
2
 
3
- wip
3
+ Stacks Email is driver system for sending Emails.
4
4
 
5
5
  ## ☘️ Features
6
6
 
7
- wip
7
+ - 📦 Send Email
8
8
 
9
- - ⚡️
9
+ ## 🤖 Usage
10
10
 
11
- wip
11
+ ```bash
12
+ pnpm i -D @stacksjs/email
13
+ ```
12
14
 
13
- ## 🤖 Usage
15
+ You may now use it in your project:
16
+
17
+ ```ts
18
+ import * as email from '@stacksjs/email'
19
+
20
+ /* Then choose a driver. E.g for sendgrid */
21
+ const notification = email.sendgrid
22
+
23
+ notification.send(EmailOptions)
24
+
25
+ interface EmailOptions {
26
+ to: string | string[]
27
+ subject: string
28
+ html: string
29
+ from?: string
30
+ text?: string
31
+ attachments?: AttachmentOptions[]
32
+ id?: string
33
+ }
34
+ ```
14
35
 
15
- wip
36
+ ### Drivers
37
+
38
+ Drivers are configured with the following environment variables:
39
+
40
+ #### Sendgrid
16
41
 
17
42
  ```bash
18
- pnpm i -D @stacksjs/notifications
43
+ SENDGRID_API_KEY=SG123
44
+ SENDGRID_FROM=from@example.com
45
+ SENDGRID_SENDER_NAME=Sender
19
46
  ```
20
47
 
21
- Now, you can use it in your project:
48
+ #### Mailgun
49
+
50
+ ```bash
51
+ MAILGUN_API_KEY=MG123
52
+ MAILGUN_DOMAIN=example.com
53
+ MAILGUN_USERNAME=username
54
+ MAILGUN_FROM=from@example.com
55
+ ```
22
56
 
23
- ```js
24
- import notifications from '@stacksjs/notifications'
57
+ #### Mailjet
25
58
 
26
- // wip
59
+ ```bash
60
+ MAILJET_API_KEY=MJ123
61
+ MAILJET_API_SECRET=MJTESTSECRET
62
+ MAILJET_FROM_EMAIL=from@example.com
27
63
  ```
28
64
 
29
- ## 🤖 Drivers
65
+ #### Netcore
30
66
 
31
- ### Email
67
+ ```bash
68
+ NETCORE_API_KEY=NC123
69
+ NETCORE_FROM=from@example.com
70
+ ```
32
71
 
33
- - Sendgrid
34
- - Mailgun
35
- - Mailjet
36
- - Netcore
37
- - Nodemailer
38
- - Post Mark
39
- - Ses
40
- - Mandrill
41
- - EmailJS
72
+ #### Nodemailer
42
73
 
43
- ### SMS
74
+ ```bash
75
+ NODEMAILER_FROM_EMAIL=from@example.com
76
+ NODEMAILER_HOST=example.com
77
+ NODEMAILER_USERNAME=username
78
+ NODEMAILER_PASSWORD=password
79
+ NODEMAILER_PORT=25
80
+ NODEMAILER_SECURE=true
81
+ ```
44
82
 
45
- - Twilio
46
- - Nexmo
47
- - Gupshup
48
- - Plivo
49
- - SMS77
50
- - SNS
51
- - Telnyx
52
- - Termii
83
+ #### Postmark
53
84
 
54
- ### Chat
85
+ ```bash
86
+ POSTMARK_API_KEY=PM123
87
+ POSTMARK_FROM=from@example.com
88
+ ```
55
89
 
56
- - Discord
57
- - Slack
90
+ #### AWS SES
91
+
92
+ ```bash
93
+ SES_REGION=US
94
+ SES_ACCESS_KEY_ID=testkey123
95
+ SES_SECRET_ACCESS_KEY=testaccesskey123
96
+ SES_FROM=from@example.com
97
+ ```
98
+
99
+ #### Mandrill
100
+
101
+ ```bash
102
+ MANDRILL_API_KEY=Ma123
103
+ MANDRILL_EMAIL=from@example.com
104
+ ```
105
+
106
+ #### EmailJS
107
+
108
+ ```bash
109
+ EMAILJS_FROM_EMAIL=from@example.com
110
+ EMAILJS_HOST=example.com
111
+ EMAILJS_USERNAME=username
112
+ EMAILJS_PASSWORD=password
113
+ EMAILJS_PORT=25
114
+ EMAILJS_SECURE=true
115
+ ```
58
116
 
59
117
  Learn more in the docs.
60
118
 
@@ -82,6 +140,14 @@ For casual chit-chat with others using this package:
82
140
 
83
141
  [Join the Stacks Discord Server](https://discord.ow3.org)
84
142
 
143
+ ## 🙏🏼 Credits
144
+
145
+ Many thanks to the following core technologies & people who have contributed to this package:
146
+
147
+ - [Chris Breuer](https://github.com/chrisbbreuer)
148
+ - [Novu](https://novu.co/)
149
+ - [All Contributors](../../contributors)
150
+
85
151
  ## 📄 License
86
152
 
87
153
  The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information.
@@ -1,3 +1,4 @@
1
+ export declare const email: any;
1
2
  declare const _default: {
2
3
  email: any;
3
4
  };
@@ -1,5 +1,5 @@
1
1
  import { notification } from "@stacksjs/config";
2
- const email = notification.email;
2
+ export const email = notification.email;
3
3
  export default {
4
4
  email
5
5
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/email",
3
3
  "type": "module",
4
- "version": "0.47.2",
4
+ "version": "0.48.1",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks Email integration. Painlessly create & manage your inboxes, templates, and send emails.",
7
7
  "author": "Chris Breuer",
@@ -21,7 +21,15 @@
21
21
  "ses",
22
22
  "aws",
23
23
  "maizzle",
24
- "stacks"
24
+ "stacks",
25
+ "emailjs",
26
+ "mailgun",
27
+ "mailjet",
28
+ "mandrill",
29
+ "netcore",
30
+ "nodemailer",
31
+ "postmark",
32
+ "sendgrid"
25
33
  ],
26
34
  "main": "dist/index.mjs",
27
35
  "module": "dist/index.mjs",
@@ -50,15 +58,15 @@
50
58
  "@novu/sendgrid": "^0.10.0",
51
59
  "@novu/ses": "^0.10.0",
52
60
  "@novu/stateless": "^0.10.0",
53
- "@stacksjs/cli": "0.47.2",
54
- "@stacksjs/config": "0.47.2",
55
- "@stacksjs/error-handling": "0.47.2",
56
- "@stacksjs/types": "0.47.2"
61
+ "@stacksjs/cli": "0.48.1",
62
+ "@stacksjs/config": "0.48.1",
63
+ "@stacksjs/error-handling": "0.48.1",
64
+ "@stacksjs/types": "0.48.1"
57
65
  },
58
66
  "devDependencies": {
59
67
  "mkdist": "^1.0.0",
60
68
  "typescript": "^4.9.4",
61
- "@stacksjs/testing": "0.47.2"
69
+ "@stacksjs/testing": "0.48.1"
62
70
  },
63
71
  "scripts": {
64
72
  "build": "mkdist -d",