sendEmailVerification method
Request the verification of the email address of a profile. If there is an email address configured in the profile that was not already verified, sends an email to verify it.
Returns a bool that indicates if the email was sent (false
if the email was already verified).
Parameters:
accessToken
- ConsideringauthToken
a valid OAuth token, accessToken isauthToken.accessToken
.trueClientIP
- An optional header field; IP to protect requests from the backend. Note: For more details, see Identity Fraud Protection.trueClientIPKey
- An optional header field; the secret that must match the True-Client-IP-Key generated in the ReachFive console. Note: For more details, see Identity Fraud Protection.redirectUrl
- The URL sent in the verification email to which the profile is redirected. This URL must be whitelisted in theAllowed Callback URLs
field of your ReachFive client settings.returnToAfterEmailConfirmation
- Returned in theredirect_url
as a query parameter, this parameter is used as the post-email confirmation URL. It must be a valid URL.customLocale
- For any endpoint in this specification that generates an email or SMS, you can pass the Custom-Locale attribute as a header parameter.
Implementation
Future<bool> sendEmailVerification({
required String accessToken,
String? trueClientIP,
String? trueClientIPKey,
String? redirectUrl,
String? returnToAfterEmailConfirmation,
Locale? customLocale,
}) async {
final sendEmailVerificationRequest = SendEmailVerificationRequest(
redirectUrl: redirectUrl,
returnToAfterEmailConfirmation: returnToAfterEmailConfirmation,
);
final authorization = 'Bearer $accessToken';
final response = await emailApi.sendEmailVerification(
authorization: authorization,
trueClientIP: trueClientIP,
trueClientIPKey: trueClientIPKey,
sendEmailVerificationRequest: sendEmailVerificationRequest,
customLocale: customLocale?.toLanguageTag(),
);
return response.data?.verificationEmailSent ?? false;
}