Skip to main content
Matt Bradley-Roberts ha preguntado en #Apex
Hello,

I have a scenario whereby we want to send a verification code (not a link) to the new email address when an external identity user (community) changes their email address. The scenario is:

  1. User enters new email address
  2. Verification code is sent to the new email and page displays to enter the code
  3. If verification code is entered, then email is updated

    • If not, the email is not updated
  4. Both email addresses are notified on successful change.

I cannot find any way to generate and send a code in this scenario, only during self-registration and user creation. Does anyone know a way to do this using some standard functionality, or do we have to write custom code to handle db savepoints, code generation, store it against the user, verify it etc. in a custom class?

Any guidance much appreciated.

Thanks,

Matt
1 respuesta
  1. 7 feb 2020, 21:55
    I know for sure that custom code can be written for this but I wonder if there would be a simpler way. I wonder if it is possible to create an email template based on a visualforce page and on the visualforce page, make it showcase a random number and an input field. The user would need to input the random number shown to verify the change. Not sure if this is possible though but this is my thought process. I'll need to experiment. This may take some time to develop though.