Hi, there. I keep all new user entries in Strapi, as well as more content.
Question: Can I get email notifications when there’s a new user entry? What should I use?
Yes, you can achieve that by using index.js file which is located in /src/index.js
and add the below code to fulfil your requirement
"use strict";
module.exports = {
register(/*{ strapi }*/) {},
bootstrap({ strapi }) {
strapi.db.lifecycles.subscribe({
models: ["plugin::users-permissions.user"],
async afterCreate({ ctx, params }) {
console.log(params.data) // Get all details of newly created user
// ADD YOUr SEND MAIL CODE
},
});
},
};
Hope this helps you
2 Likes