I stumbled across a requirement that is to not allow the users to log in in the communities/portal upon self-registration until they confirm the registration (activation link must be sent through an email).

This is a standard process for almost every other portal on the net. It seems like that Salesforce doesn't have out-of-the-box functionality to support this yet.

At this stage I have only found a Question and an Idea.

My solution is to set the user Inactive upon registering and generate a random hash (before insert trigger) with an expiry date. Then change the default self-registration email template to include this hash into a link to a publicly exposed page that will validate the hash and find/activate the user, and finally log them in.

1) Has anyone else tried to do this before, and how did you approach this? Is there a better idea than my proposed solution?

2) Is there any official documentation around this that I might be missing here?

1 Answer 1


I've done pretty much exactly what you describe before. Rather than using the inactive flag, I used a custom Boolean to represent that the user had not self-validated, and used this to deny access upon login.

It seems the right approach to me and isn't much work. AFAIK there is no official support for user email validation for self-registered users but I can't point you to any docs on the subject.

  • How do you control the login process if the user has not self-validated?
    – RajeshShah
    Jan 3, 2017 at 15:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .