Automattic\WooCommerce\Internal\CustomerEmailVerification
VerificationController::result_notice
Map a redirect result code to its [ message, notice type ], or null for an unknown code.
Method of the class: VerificationController{}
No Hooks.
Returns
Array{0:. string, 1: string}|null
Usage
// private - for code of main (parent) class only $result = $this->result_notice( $code ): ?array;
- $code(string) (required)
- Result code from a send/confirm redirect.
VerificationController::result_notice() VerificationController::result notice code WC 11.0.0
private function result_notice( string $code ): ?array {
switch ( $code ) {
case 'sent':
return array( __( 'A confirmation link has been sent to your email address. Please check your inbox.', 'woocommerce' ), 'success' );
case 'throttled':
return array( __( 'A confirmation link was sent recently. Please check your inbox, or wait a moment before requesting a new one.', 'woocommerce' ), 'notice' );
case 'confirmed':
return array( __( 'Your email address has been confirmed.', 'woocommerce' ), 'success' );
case 'expired':
return array( __( 'This confirmation link is invalid or has expired. Please request a new one.', 'woocommerce' ), 'error' );
case 'mismatch':
return array( __( 'Unable to confirm this email while you are logged in to a different account. Please log out and open the link again.', 'woocommerce' ), 'error' );
case 'invalid':
return array( __( 'Invalid request. Please try again.', 'woocommerce' ), 'error' );
default:
return null;
}
}