Customer contact self registration process

Luke James
Tera Contributor

Hello All, 

 

I have a requirement where within the Customer contact self registration process, instead of having the approval step that is OOTB, we would replace that with an email verification email to the contact requesting access. When the contact clicks the email verification link, it then creates the access for that contact as it does OOTB in the Customer registration flow. 

 

Does anybody know how to do this? Or has done it before? 

 

Kind Regards, 

 

Luke

1 REPLY 1

KKM
Tera Guru

Hi Luke,

To replace the approval step in the Customer Contact Self-Registration process with an email verification flow, follow these steps:

1. Modify the Self-Registration Flow
By default, ServiceNow Customer Service Management (CSM) includes an approval step. You need to:

Remove the approval step.
Add an email verification step.
Steps:
Navigate to Process Automation > Flow Designer.
Locate the Customer Contact Self-Registration flow.
Remove the approval step.
Add a new action for sending an email verification.

2. Generate and Send an Email with a Verification Link
Use the "Send Email" action in Flow Designer.
The email should contain a verification link that includes a unique token.
Example Email Template:

Hello {first_name},

Thank you for registering. Please verify your email by clicking the link below:

<a href="https://your-instance.service-now.com/x/your_custom_app/verify_email?id={sys_id}&token={token}">Verify Email</a>

If you didn’t request this, please ignore this email.

Best,
Customer Support

3. Create an Endpoint to Handle Email Verification
You need a Scripted REST API or a UI Page to handle the verification link.

Steps to Create a Scripted REST API
Go to System Web Services > Scripted REST APIs.
Create a new API: VerifyEmailAPI.
Add an HTTP GET resource to validate the token.
Example Script to Verify Email
(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
var id = request.queryParams.id;
var token = request.queryParams.token;

var user = new GlideRecord('sys_user');
user.addQuery('sys_id', id);
user.addQuery('u_verification_token', token);
user.query();

if (user.next()) {
user.active = true;
user.u_verification_token = ''; // Clear token after use
user.update();
response.setStatus(200);
response.setBody({ success: true, message: "Email verified. Your account is now active." });
} else {
response.setStatus(400);
response.setBody({ success: false, message: "Invalid or expired token." });
}
})(request, response);

4. Automatically Activate the Account
Once the email is verified:

Mark the user as active (user.active = true).
Remove the temporary verification token.
Send a welcome email with login instructions.

5. Test the Flow
Register a new contact.
Check if they receive the verification email.
Click the link and ensure the user is activated.

6. Final Deployment
Update business rules to prevent unverified users from logging in.
Monitor logs and email notifications.
This ensures a seamless self-registration process without requiring manual approvals.

Kindly mark it as "Accepted Solution"/"helpful", as it resolves your query. Please press like button for the resolution provided.

With Regards,
Krishna Kumar M - Talk with AIT3ch
LinkedIn: https://www.linkedin.com/in/mkrishnak4/
YouTube: https://www.youtube.com/@KrishAIT3CH
Topmate: https://topmate.io/mkrishnak4 [ Connect for 1-1 Session]