Add a New User to an Existing Organization

The code snippet given below allows registering a user to an existing orginization without creating a new organization.

Note:
  • FirstName, EmailId and OrgIDare mandatory attributes.

  • When inviting a new user, you can configure the sender’s email address, subject and the email message. You must add the email address in the Catalyst Mail Component and get it verified before using it in the SDK code.

Ensure the following packages are imported:

    
Package Imports
copy
import com.zc.component.users.PlatformType; import com.zc.component.users.ZCSignUpData; import com.zc.component.users.ZCUser; import com.zc.component.ZCMailTemplateDetails;
    
copy
//Get an instance of ZCSignUpData ZCSignUpData signUpdetails = ZCSignUpData.getInstance(); //Pass the necessary data for the sign-up using the instance ZCMailTemplateDetails mailData= signUpdetails.mailTemplateInstance(); mailData.setSendersMail("docofoh552@lukaat.com"); mailData.setSubject("Welcome to %APP_NAME%"); mailData.setMessage("

Hello ,

Follow this link to join in %APP_NAME% .

%LINK%

If you didn’t ask to join the application, you can ignore this email.

Thanks,

Your %APP_NAME% team

"); signUpdetails.setTemplateDetails(mailData); signUpdetails.setPlatformType(PlatformType.WEB); signUpdetails.userDetail.setEmailId("amelia.burrows@zylker.com"); signUpdetails.userDetail.setLastName("Amelia"); signUpdetails.userDetail.setOrgId("35712181"); //Pass user's OrgID here //Register the user using signUpdetails signUpdetails = ZCUser.getInstance().addUser(signUpdetails);

Last Updated 2023-10-16 12:55:33 +0530 +0530