@aphexcms/nodemailer-adapter 15.0.1 → 15.0.2
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 +53 -0
- package/package.json +4 -5
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# @aphexcms/nodemailer-adapter
|
|
2
|
+
|
|
3
|
+
SMTP email adapter for [AphexCMS](https://github.com/IcelandicIcecream/aphex), built on [Nodemailer](https://nodemailer.com).
|
|
4
|
+
|
|
5
|
+
Implements the `EmailAdapter` contract from `@aphexcms/cms-core`. Aphex uses it for password resets, email verification, and organization invitations — and any plugin or job that sends mail.
|
|
6
|
+
|
|
7
|
+
Prefer `@aphexcms/resend-adapter` in production unless you have an SMTP server you want to use.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add @aphexcms/nodemailer-adapter
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
```ts title="src/lib/server/email/index.ts"
|
|
18
|
+
import { createNodemailerAdapter } from '@aphexcms/nodemailer-adapter';
|
|
19
|
+
|
|
20
|
+
export const email = createNodemailerAdapter({
|
|
21
|
+
host: env.SMTP_HOST,
|
|
22
|
+
port: Number(env.SMTP_PORT),
|
|
23
|
+
auth: { user: env.SMTP_USER, pass: env.SMTP_PASSWORD }
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```ts title="aphex.config.ts"
|
|
28
|
+
export default createCMSConfig({
|
|
29
|
+
schemaTypes,
|
|
30
|
+
database: db,
|
|
31
|
+
email
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Local development with Mailpit
|
|
36
|
+
|
|
37
|
+
`createMailpitAdapter()` is the same adapter pre-pointed at Mailpit on `localhost:1025`, so mail you send in development is captured instead of delivered — read it at `http://localhost:8025`.
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { createMailpitAdapter } from '@aphexcms/nodemailer-adapter';
|
|
41
|
+
|
|
42
|
+
export const email = dev ? createMailpitAdapter() : createNodemailerAdapter({ ... });
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`pnpm db:start` in the Aphex monorepo brings Mailpit up alongside Postgres.
|
|
46
|
+
|
|
47
|
+
## Email verification is off by default
|
|
48
|
+
|
|
49
|
+
A fresh Aphex project doesn't require verification, so the first account can sign in with no mail server at all. Turn it on with `AUTH_REQUIRE_EMAIL_VERIFICATION=true` once you have an adapter configured — recommended in production, since without it anyone can sign up with an address they don't own.
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aphexcms/nodemailer-adapter",
|
|
3
|
-
"version": "15.0.
|
|
3
|
+
"version": "15.0.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -25,16 +25,15 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"nodemailer": "^
|
|
29
|
-
"@aphexcms/cms-core": "^9.2.1"
|
|
28
|
+
"nodemailer": "^9.0.3"
|
|
30
29
|
},
|
|
31
30
|
"peerDependencies": {
|
|
32
|
-
"@aphexcms/cms-core": "
|
|
31
|
+
"@aphexcms/cms-core": ">=11.0.0"
|
|
33
32
|
},
|
|
34
33
|
"devDependencies": {
|
|
35
34
|
"@types/nodemailer": "^6.4.17",
|
|
36
35
|
"typescript": "^5.9.3",
|
|
37
|
-
"@aphexcms/cms-core": "^
|
|
36
|
+
"@aphexcms/cms-core": "^11.0.0"
|
|
38
37
|
},
|
|
39
38
|
"scripts": {
|
|
40
39
|
"build": "tsc",
|