security.createUser
Creates a user on your MODLR account and, by default, emails them an invitation.
js
security.createUser(name, email, mobile, sendWelcomeEmail)Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The user's full name. |
email | string | The user's email address. |
mobile | string | The user's mobile number. Pass "" if you don't have one. |
sendWelcomeEmail | boolean | Optional. false to create the user without emailing them, for example when adding users in bulk. Defaults to true. |
Returns
stringThe response from MODLR's account service.
Examples
js
const user = security.createUser("admin", "admin@modlr.co", "0123 456 789", true);js
// Create a user without sending the invitation email
security.createUser("New User", "user@example.com", "", false);