sendVerificationToken
Initiates a request to verify a user and send a verification email.
sdk.rewards.methods.sendVerificationToken()sendVerificationToken(): Promise<Success | ErrorResult>Returns
Promise<Success | ErrorResult>Usage example
Before call a request, ensure the SDK and the Rewards module are ready:
function onSdkReady() {
const moduleName = window.gw.sdk.common.constants.modules.REWARDS;
window.gw.sdk.runIfModuleReady(moduleName, () => {
window.gw.sdk.rewards.methods
.sendVerificationToken()
.then(console.log)
.catch(console.error);
});
}
if (window.gw && window.gw.sdk) {
onSdkReady();
} else {
document.addEventListener("gwSdkReady", onSdkReady);
}
This code ensures that the SDK and the Rewards module are ready before attempting to call a request. The method will either succeed, returning a success result, or fail, returning an error with details about what went wrong.