@adminforth/open-signup 1.1.2 → 1.1.4
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 +7 -0
- package/dist/index.js +25 -15
- package/index.ts +26 -16
- package/package.json +2 -1
package/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# AdminForth OpenSignup Plugin
|
|
2
|
+
|
|
3
|
+
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT" /> <img src="https://woodpecker.devforth.io/api/badges/3848/status.svg" alt="Build Status" /> <a href="https://www.npmjs.com/package/@adminforth/open-signup"> <img src="https://img.shields.io/npm/dt/@adminforth/open-signup" alt="npm downloads" /></a> <a href="https://www.npmjs.com/package/@adminforth/open-signup"><img src="https://img.shields.io/npm/v/@adminforth/open-signup" alt="npm version" /></a> <a href="https://www.npmjs.com/package/@adminforth/open-signup">
|
|
4
|
+
|
|
5
|
+
Allows users to register in adminforth by them-selfs without admin.
|
|
6
|
+
|
|
7
|
+
## For usage, see [AdminForth OpenSignup Documentation](https://adminforth.dev/docs/tutorial/Plugins/open-signup/)
|
package/dist/index.js
CHANGED
|
@@ -267,21 +267,31 @@ export default class OpenSignupPlugin extends AdminForthPlugin {
|
|
|
267
267
|
The {brandName} Team
|
|
268
268
|
|
|
269
269
|
`, 'opensignup', { brandName, url, verifyToken });
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
270
|
+
const emailData = {
|
|
271
|
+
greeting: yield tr('Dear user,', 'opensignup'),
|
|
272
|
+
welcome: yield tr('Welcome to {brandName}!', 'opensignup', { brandName }),
|
|
273
|
+
instruction: yield tr('To confirm your email, click the link below:', 'opensignup'),
|
|
274
|
+
linkText: yield tr('Confirm email', 'opensignup'),
|
|
275
|
+
disclaimer: yield tr('If you didn\'t request this, please ignore this email.', 'opensignup'),
|
|
276
|
+
validity: yield tr('Link is valid for 2 hours.', 'opensignup'),
|
|
277
|
+
thanks: yield tr('Thanks,', 'opensignup'),
|
|
278
|
+
team: yield tr('The {brandName} Team', 'opensignup', { brandName }),
|
|
279
|
+
};
|
|
280
|
+
const emailHtml = `
|
|
281
|
+
<html>
|
|
282
|
+
<head></head>
|
|
283
|
+
<body>
|
|
284
|
+
<p>${emailData.greeting}</p>
|
|
285
|
+
<p>${emailData.welcome}</p>
|
|
286
|
+
<p>${emailData.instruction}</p>
|
|
287
|
+
<a href="${url}?token=${verifyToken}">${emailData.linkText}</a>
|
|
288
|
+
<p>${emailData.disclaimer}</p>
|
|
289
|
+
<p>${emailData.validity}</p>
|
|
290
|
+
<p>${emailData.thanks}</p>
|
|
291
|
+
<p>${emailData.team}</p>
|
|
292
|
+
</body>
|
|
293
|
+
</html>
|
|
294
|
+
`;
|
|
285
295
|
const emailSubject = yield tr(`Signup request at {brandName}`, 'opensignup', { brandName });
|
|
286
296
|
// send email with AWS SES this.options.providerOptions.AWS_SES
|
|
287
297
|
this.options.confirmEmails.adapter.sendEmail(this.options.confirmEmails.sendFrom, email, emailText, emailHtml, emailSubject);
|
package/index.ts
CHANGED
|
@@ -310,23 +310,33 @@ export default class OpenSignupPlugin extends AdminForthPlugin {
|
|
|
310
310
|
|
|
311
311
|
`, 'opensignup', { brandName, url, verifyToken }
|
|
312
312
|
);
|
|
313
|
-
|
|
314
|
-
const emailHtml = await tr(`
|
|
315
|
-
<html>
|
|
316
|
-
<head></head>
|
|
317
|
-
<body>
|
|
318
|
-
<p>Dear user,</p>
|
|
319
|
-
<p>Welcome to {brandName}!</p>
|
|
320
|
-
<p>To confirm your email, click the link below:</p>
|
|
321
|
-
<a href="{url}?token={verifyToken}">Confirm email</a>
|
|
322
|
-
<p>If you didn't request this, please ignore this email.</p>
|
|
323
|
-
<p>Link is valid for 2 hours.</p>
|
|
324
|
-
<p>Thanks,</p>
|
|
325
|
-
<p>The {brandName} Team</p>
|
|
326
|
-
</body>
|
|
327
|
-
</html>
|
|
328
|
-
`, 'opensignup', { brandName, url, verifyToken });
|
|
329
313
|
|
|
314
|
+
const emailData = {
|
|
315
|
+
greeting: await tr('Dear user,', 'opensignup'),
|
|
316
|
+
welcome: await tr('Welcome to {brandName}!', 'opensignup', { brandName }),
|
|
317
|
+
instruction: await tr('To confirm your email, click the link below:', 'opensignup'),
|
|
318
|
+
linkText: await tr('Confirm email', 'opensignup'),
|
|
319
|
+
disclaimer: await tr('If you didn\'t request this, please ignore this email.', 'opensignup'),
|
|
320
|
+
validity: await tr('Link is valid for 2 hours.', 'opensignup'),
|
|
321
|
+
thanks: await tr('Thanks,', 'opensignup'),
|
|
322
|
+
team: await tr('The {brandName} Team', 'opensignup', { brandName }),
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
const emailHtml = `
|
|
326
|
+
<html>
|
|
327
|
+
<head></head>
|
|
328
|
+
<body>
|
|
329
|
+
<p>${emailData.greeting}</p>
|
|
330
|
+
<p>${emailData.welcome}</p>
|
|
331
|
+
<p>${emailData.instruction}</p>
|
|
332
|
+
<a href="${url}?token=${verifyToken}">${emailData.linkText}</a>
|
|
333
|
+
<p>${emailData.disclaimer}</p>
|
|
334
|
+
<p>${emailData.validity}</p>
|
|
335
|
+
<p>${emailData.thanks}</p>
|
|
336
|
+
<p>${emailData.team}</p>
|
|
337
|
+
</body>
|
|
338
|
+
</html>
|
|
339
|
+
`;
|
|
330
340
|
const emailSubject = await tr(`Signup request at {brandName}`, 'opensignup', { brandName });
|
|
331
341
|
|
|
332
342
|
// send email with AWS SES this.options.providerOptions.AWS_SES
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adminforth/open-signup",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
7
|
+
"homepage": "https://adminforth.dev/docs/tutorial/Plugins/open-signup/",
|
|
7
8
|
"scripts": {
|
|
8
9
|
"build": "tsc && rsync -av --exclude 'node_modules' custom dist/",
|
|
9
10
|
"prepare": "npm link adminforth"
|