Search.../

verifyEmail( )

Developer Preview

Verifies the sender's email using a verification code sent to the user's email address upon update.

Description

This function is not a universal function and runs only on the backend.

Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function verifyEmail(verificationCode: string): Promise<void>

verifyEmail Parameters

NAME
TYPE
DESCRIPTION
verificationCode
string

Verification code.

Returns

Return Type:

Promise<
void
>

Was this helpful?

Verifies an updated sender address with a verification code (dashboard page code)

Copy Code
1import { senderDetails } from 'wix-email-marketing.v2';
2
3// Sample verificationCode: "Sw4e7"
4
5export async function myVerifyEmailFunction(verificationCode) {
6 try {
7 const result = await senderDetails.verifyEmail(verificationCode);
8
9 console.log('Success! Your email address has been verified')
10 return result;
11 } catch (error) {
12 console.error(error);
13 }
14}
15
16/* Promise returns void */
Verifies an updated sender address with a verification code (export from backend code)

Copy Code
1import { Permissions, webMethod } from 'wix-web-module';
2import { senderDetails } from 'wix-email-marketing.v2';
3
4// Sample verificationCode: "Sw4e7"
5
6export const myVerifyEmailFunction = webMethod(Permissions.Anyone, async (verificationCode) => {
7 try {
8 const result = await senderDetails.verifyEmail(verificationCode);
9
10 console.log('Success! Your email address has been verified')
11 return result;
12 } catch (error) {
13 console.error(error);
14 }
15});
16
17/* Promise returns void */
18