-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(api,web): built in novu integrations for self hosted #5158
Conversation
❌ Deploy Preview for dev-web-novu failed.
|
if ( | ||
(command.providerId === SmsProviderIdEnum.Novu && !areNovuSmsCredentialsSet()) || | ||
(command.providerId === EmailProviderIdEnum.Novu && !areNovuEmailCredentialsSet()) | ||
) { | ||
throw new BadRequestException(`Creating Novu integration for ${command.providerId} provider is not allowed`); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when creating the Novu integration for SMS or Email check if the environment variables for the provider credentials are set, if not throw an exception
async execute(command: CreateNovuIntegrationsCommand): Promise<void> { | ||
await this.createEmailIntegration(command); | ||
await this.createSmsIntegration(command); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before: when some of the SMS or Email credentials were not set it didn't create any integration, for example even if Email credentials were set correctly
now: it does checks independently and will create Email/SMS integration if credentials are set
if (IS_DOCKER_HOSTED) { | ||
initialEmailProviders = emailProviders.filter((provider) => provider.id !== EmailProviderIdEnum.Novu); | ||
initialSmsProviders = smsProviders.filter((provider) => provider.id !== SmsProviderIdEnum.Novu); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for self hosted - hide Novu Email and SMS integrations
@@ -29,7 +29,7 @@ | |||
"access": "public" | |||
}, | |||
"dependencies": { | |||
"@novu/stateless": "0.22.0", | |||
"@novu/stateless": "0.23.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing version update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A very subtle note, can we convert this file name to novu-integrations.ts
some systems might have issues not catching the capital letter when renamed. (Windows mostly)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
What change does this PR introduce?
Do not create Novu integrations when there are no credentials set for Novu Email or Novu SMS providers.
For self-hosted do not show the Novu providers on the Integrations page.
Missing E2E tests.
Why was this change needed?
Other information (Screenshots)
Screen.Recording.2024-02-05.at.10.44.17.mov