diff --git a/.gitignore b/.gitignore index d49a1b56fe..ce404522ff 100644 --- a/.gitignore +++ b/.gitignore @@ -99,4 +99,5 @@ cdk.context.json packages/cognito-custom-mail-lambda/**/*.html -.tmp \ No newline at end of file +.tmp +.vs diff --git a/packages/cognito-custom-mail-lambda/src/mailer/custom-mailer.ts b/packages/cognito-custom-mail-lambda/src/mailer/custom-mailer.ts index e791e04403..8cbf1226ce 100644 --- a/packages/cognito-custom-mail-lambda/src/mailer/custom-mailer.ts +++ b/packages/cognito-custom-mail-lambda/src/mailer/custom-mailer.ts @@ -44,15 +44,15 @@ const getConfirmRegistrationUrl = async (emailAddress: string) => { return confirmRegistrationUrl } const user: UserModel = await res.json() - if (user.products.length === 1) { - const productId = user.products[0].id + + if (user.products.length > 0) { + const productId = (user.products[0].id || '').toLowerCase() if (productId === 'agentbox') return agentboxUrl if (productId === 'agentpoint') return agentpointUrl - if (productId === 'consoleCloud') return consoleUrl - if (productId === 'ireWeb') return ireUrl - if (productId === 'mmiWeb') return mmiUrl + if (productId === 'consolecloud') return consoleUrl + if (productId === 'ireweb') return ireUrl + if (productId === 'mmiweb') return mmiUrl } - return confirmRegistrationUrl }