Include password in registration email

We are trying to include the user password in the “User made registration” template.
Our application won’t include public registration, instead it will have users created by an admin.
We are generating a random password and including this in the user registration using the javascript api, so we then want this password to be sent out in the email.

We have tried using {password} as a substitution but this doesn’t get replaced with the password.

Is there any way to do this?

Backendless Version (3.x / 6.x, Online / Managed / Pro )

Backendless Cloud

Client SDK (REST / Android / Objective-C / Swift / JS )

Javascript

Expected Behavior

  1. Admin registers a new user email
  2. Password is generated and submitted with the user object
  3. Registration email is sent including the user password

Actual Behavior

Received email shows “{password}” instead of the user password.

Hi Tony,

The built-in template will not work for what you’re trying to do. Backendless stores passwords in the encrypted form and there is no way to “unhash” it to the raw value. A workaround would look something like this:

  1. Add a beforeRegister event handler (in cloud code). In your handler replicate the password column in another column of the Users table (for example rawPassword).
  2. Create a custom email template where you will use the “smart text” feature and bind to the rawPassword column.
  3. Add another event handler - afterRegister where you will use the API to send out an email with a custom template.

Hope this helps.

Regards,
Mark