I have a custom VF page I'm using to allow users to register for a community. Is it possible to create their user record, then take them directly to the change password page without forcing them to retrieve the email and click the link?

The main reason for this is: I have a custom VF page inside an iframe and they'll obviously lose that context once they have to open the link from the email.

EDIT: I received a vote to close and a link to a question about group email settings that, after reading, doesn't seem to answer my question. Perhaps I need to clarify:

After they complete the registration form I create their account, contact, and user records. When the user is inserted it currently triggers an email notification that includes a link to (ex. https://.force.com/landing/login?c=LONGSTRINGOFCHARS). They can then click on that link to take them directly the the change password page.

Since my site is in an iframe what I'm trying to do is allow them to complete my custom registration form, then take them directly to this change password page but I'm not sure how. I don't know what that LONGSTRINGOFCHARS represents that allows them to directly link to the new change password page. I'm assuming some type of authentication token?

  • Hey, I mistakenly tagged a duplicate and retracted my duplicate vote. Sorry about that. – greenstork Sep 30 '13 at 14:23
  • It would help a lot if we could actually see LONGSTRINGOFCHARS. – Adrian Larson Sep 30 '13 at 15:59
  • Here's an example: OYhoz8rVXqJ3tUHAY%2B7ian2Mmm%2Bv7H19sfkuTsn%2FlNt7pLFQaUkvnxAYqsIjGhJOG%2B2lyFsl6HTgfrwokyynKED1MfoktkygLFSEy9RvNFsAtg%3D%3a – Phil B Sep 30 '13 at 16:04

To prevent the email from going out when inserting the user you will need to include the DMLOptions.EmailHeader property in you dml statement and set triggerUserEmail to false.

To have the user change their password set it in the code with the setpassword method (IMPORTANT: this should be a unique hash for every user) on your registration page and then forward them directly to the change password page when calling Site.Login.

| improve this answer | |
  • The triggeruseremail flag doesn't seem to work. However, if I create a user with the Site.createPortalUser(user,accountID,password) I'm able to set their password explicitly and then call Site.login. – Phil B Sep 30 '13 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.