A new verification feature in the Spring '22 release is that an user will receive a verification email once per release when they instigate an email. I'm trying to use Apex to send a mass email out to those users who have unverified email addresses all at once.
UserManagement Class Apex Developer Guide documentation for sendAsyncEmailConfirmation is here.
Using SF Developer Console's Open Execute Anonymous Window, I am trying to send an email to a user to verify their email.
System.UserManagement.sendAsyncEmailConfirmation(UserId, null, null, null);
I even tried to set the field HasUserVerifiedEmailAddress from TwoFactorMethodsInfo to false before sending the verification link email, but that still brings the user to SF login screen.
In Dev Console, ran this (which still brought user to login screen): System.UserManagement.deregisterVerificationMethod(UserId,Auth.VerificationMethod.EMAIL); System.UserManagement.sendAsyncEmailConfirmation(UserId, null, null, null);
What syntax is needed to get the unverified email user an email that when clicking the link brings you to a SF Verify Account/Email Screen please? I don't want users to have to change their password. I just want them to be directed to a Verify Account/Email screen where all they have to do is click the button.