From 45434109a956a7ffdac3ec6db582ce4d3002621d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Mon, 26 May 2025 14:57:06 +0100 Subject: [PATCH] chore: don't include passwordLink if it's unleashUrl (#10029) https://linear.app/unleash/issue/2-3572/fix-dont-include-passwordlink-if-its-the-same-as-unleashurl In case we don't have password auth enabled (`passwordLink === unleashUrl`), we should see the alternative branch in our getting started email: https://github.com/Unleash/unleash/blob/e52fcd11e06256a6158a0fe321a322d0259c5bf6/src/mailtemplates/getting-started-new/getting-started-new.html.mustache#L40-L45 This change helps us validate this behavior within the `newGettingStartedEmail`. If it works correctly for both cases (password auth enabled/disabled) we can probably clean this up as part of our flag removal. --- src/lib/services/email-service.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/services/email-service.ts b/src/lib/services/email-service.ts index bdf2396843..8c2d1955ed 100644 --- a/src/lib/services/email-service.ts +++ b/src/lib/services/email-service.ts @@ -430,6 +430,9 @@ export class EmailService { let gettingStartedTemplate = 'getting-started'; if (this.flagResolver.isEnabled('newGettingStartedEmail')) { gettingStartedTemplate = 'getting-started-new'; + if (passwordLink === unleashUrl) { + delete context.passwordLink; + } } const bodyHtml = await this.compileTemplate(