Commit 4f3d81bc by jay

.

1 parent 20dc66c1
......@@ -122,6 +122,22 @@
"type": "relation",
"relation": "oneToOne",
"target": "api::township.township"
},
"termsAndConditions": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "boolean"
},
"existingOwner": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "boolean"
}
}
}
......@@ -45,12 +45,10 @@ const userPermissionExtension = (plugin) => {
where: {
$and: [
{ publishedAt: { $notNull: true } },
// { user: { email: { $eq: emailAddress } } },
{ mobileNo: mobileNumber },
],
},
});
if (!endUser) {
throw new ValidationError(
"No end user registered with specified email address, mobile number combination."
......@@ -71,7 +69,7 @@ const userPermissionExtension = (plugin) => {
{}
);
const oneTimePassword = Math.floor(100000 + Math.random() * 900000);
console.log("oneTimePassword",oneTimePassword);
const emailToSend = {
to: user.email,
from:
......@@ -83,11 +81,12 @@ const userPermissionExtension = (plugin) => {
text: `Hello ${endUser.fullName}, Your one time password to login to your partner portal is ${oneTimePassword}`,
html: `<p>Hello ${endUser.fullName}, <br></br>Your one time password to login to the hiranandani offers portal is ${oneTimePassword}</p><br /> Best Regards, <br /> Team Hiranandani.`,
};
console.log('user',user);
// NOTE: Update the user before sending the email so an Admin can generate the link if the email fails
await getService("user").edit(user.id, {
const updateUser=await getService("user").edit(user.id, {
oneTimePassword: `${oneTimePassword}`,
});
console.log("updateUser",updateUser);
// Send an email to the user.
await strapi.plugin("email").service("email").send(emailToSend);
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!