Skip to content

security.createUser ​

Creates a user on your MODLR account and, by default, emails them an invitation.

js
security.createUser(name, email, mobile, sendWelcomeEmail)

Parameters ​

ParameterTypeDescription
namestringThe user's full name.
emailstringThe user's email address.
mobilestringThe user's mobile number. Pass "" if you don't have one.
sendWelcomeEmailbooleanOptional. false to create the user without emailing them, for example when adding users in bulk. Defaults to true.

Returns ​

string

The 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);