Skip to content

Commit 09fae49

Browse files
authored
Merge pull request #337 from devforth/AdminForth/807
docs: update docs for email-invite
2 parents 1899b36 + eb53013 commit 09fae49

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

adminforth/documentation/docs/tutorial/07-Plugins/16-email-invite.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,25 @@ export default {
9393
},
9494
},
9595
plugins: [
96+
//diff-add
9697
new EmailInvitePlugin({
98+
//diff-add
9799
emailField: 'email',
100+
//diff-add
101+
passwordField: 'password_hash',
102+
//diff-add
98103
sendFrom: 'noreply@yourapp.com',
104+
//diff-add
99105
adapter: new EmailAdapterAwsSes({
106+
//diff-add
100107
region: 'us-east-1',
108+
//diff-add
101109
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
110+
//diff-add
102111
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
112+
//diff-add
103113
}),
114+
//diff-add
104115
}),
105116
],
106117
};
@@ -153,6 +164,7 @@ export default {
153164
new EmailInvitePlugin({
154165
emailField: 'email',
155166
sendFrom: 'noreply@yourapp.com',
167+
passwordField: 'password_hash',
156168
adapter: new EmailAdapterAwsSes(/* ... */),
157169
//diff-add
158170
emailConfirmedField: 'email_confirmed', // Enable email confirmation
@@ -161,3 +173,37 @@ export default {
161173
};
162174
```
163175

176+
## Mailgun usage example
177+
If you want to use this plugin with Mailgun, first install it:
178+
179+
```bash
180+
npm install @adminforth/email-adapter-mailgun
181+
```
182+
183+
Then, in the adapter options, add:
184+
185+
``` ts
186+
//diff-add
187+
import EmailAdapterMailgun from "@adminforth/adminforth-email-adapter-mailgun";
188+
189+
...
190+
191+
plugins: [
192+
new EmailInvitePlugin({
193+
emailField: 'email',
194+
passwordField: 'password_hash',
195+
sendFrom: 'noreply@yourapp.com',
196+
//diff-add
197+
adapter: new EmailAdapterMailgun({
198+
//diff-add
199+
apiKey: process.env.MAILGUN_API_KEY as string,
200+
//diff-add
201+
domain: process.env.MAILGUN_DOMAIN as string,
202+
//diff-add
203+
baseUrl: process.env.MAILGUN_REGION_URL as string,
204+
//diff-add
205+
}),
206+
}),
207+
],
208+
209+
```

0 commit comments

Comments
 (0)