@webbio/strapi-plugin-page-builder 0.12.7-platform → 0.12.8-platform
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/dist/package.json +1 -1
- package/dist/server/bootstrap.js +17 -15
- package/dist/server/content-types/user-categories/schema.json +18 -0
- package/dist/server/services/email.js +2 -0
- package/dist/tsconfig.server.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/server/bootstrap.ts +25 -16
- package/server/services/email.ts +2 -0
package/dist/package.json
CHANGED
package/dist/server/bootstrap.js
CHANGED
|
@@ -30,23 +30,25 @@ exports.default = async ({ strapi }) => {
|
|
|
30
30
|
async beforeUpdate(event) {
|
|
31
31
|
var _a;
|
|
32
32
|
if (event.params.data.id) {
|
|
33
|
-
const
|
|
33
|
+
const originalUserObject = await ((_a = strapi.entityService) === null || _a === void 0 ? void 0 : _a.findOne(constants_1.USER_PERMISSION_USER_PLUGIN, event.params.data.id, {
|
|
34
34
|
populate: { platform: { populate: { platformEmails: { populate: '*' } } } }
|
|
35
35
|
}));
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
36
|
+
if (originalUserObject &&
|
|
37
|
+
event.params.data.activateUser &&
|
|
38
|
+
event.params.data.confirmed &&
|
|
39
|
+
!originalUserObject.confirmMailSend) {
|
|
40
|
+
await strapi.service(constants_1.PAGE_BUILDER_EMAIL_PLUGIN).sendMail({
|
|
41
|
+
// @ts-ignore strapi typings
|
|
42
|
+
from: originalUserObject.platform.platformEmails.accountAcceptedMail.fromEmail,
|
|
43
|
+
to: event.params.data.email,
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
subject: originalUserObject.platform.platformEmails.accountAcceptedMail.subject,
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
text: originalUserObject.platform.platformEmails.accountAcceptedMail.message,
|
|
48
|
+
firstName: event.params.data.firstName,
|
|
49
|
+
lastName: event.params.data.lastName
|
|
50
|
+
});
|
|
51
|
+
event.params.data.confirmMailSend = true;
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
54
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "collectionType",
|
|
3
|
+
"collectionName": "user-categories",
|
|
4
|
+
"info": {
|
|
5
|
+
"singularName": "user-category",
|
|
6
|
+
"pluralName": "user-categories",
|
|
7
|
+
"displayName": "User Categories"
|
|
8
|
+
},
|
|
9
|
+
"options": {
|
|
10
|
+
"draftAndPublish": false,
|
|
11
|
+
"comment": ""
|
|
12
|
+
},
|
|
13
|
+
"attributes": {
|
|
14
|
+
"title": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -26,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
const AWS = __importStar(require("@aws-sdk/client-ses"));
|
|
27
27
|
const txtMail_email_template_text_1 = require("./private-content/mail-template/txtMail.email.template.text");
|
|
28
28
|
const constants_1 = require("../../shared/utils/constants");
|
|
29
|
+
const utils_1 = require("@strapi/utils");
|
|
29
30
|
exports.default = {
|
|
30
31
|
async sendMail(options) {
|
|
31
32
|
const { from, to, subject, text, variables } = options;
|
|
@@ -47,6 +48,7 @@ exports.default = {
|
|
|
47
48
|
}
|
|
48
49
|
catch (error) {
|
|
49
50
|
console.error(error);
|
|
51
|
+
throw new utils_1.errors.ApplicationError('Failed to send email', error);
|
|
50
52
|
}
|
|
51
53
|
},
|
|
52
54
|
async sendAdminMail(user) {
|