-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
COM-990: Allow configuration of redirect url (#65)
* include allowedRedirectUrl in resolveConfig to allow configuration of redirectUrl for different scopes * add changeset * add scope type to IsValidRedirectUrl * add check for scope in redirect-url validator * correct changeset * throw error when scope is not supported * correct defaultMessage --------- Co-authored-by: Julia Wegmayr <[email protected]>
- Loading branch information
1 parent
d21db92
commit 6b5b9a4
Showing
8 changed files
with
58 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
"@comet/brevo-api": major | ||
--- | ||
|
||
The `allowedRedirectUrl` must now be configured within the resolveConfig for each specific scope, instead of being set once for all scopes in the brevo config. | ||
|
||
```diff | ||
BrevoModule.register({ | ||
brevo: { | ||
resolveConfig: (scope: EmailCampaignContentScope) => { | ||
// change config based on scope - for example different sender email | ||
// this is just to show you can use the scope to change the config but it has no real use in this example | ||
if (scope.domain === "main") { | ||
return { | ||
apiKey: config.brevo.apiKey, | ||
doubleOptInTemplateId: config.brevo.doubleOptInTemplateId, | ||
sender: { name: config.brevo.sender.name, email: config.brevo.sender.email }, | ||
+ allowedRedirectUrl: config.brevo.allowedRedirectUrl, | ||
}; | ||
} else { | ||
return { | ||
apiKey: config.brevo.apiKey, | ||
doubleOptInTemplateId: config.brevo.doubleOptInTemplateId, | ||
sender: { name: config.brevo.sender.name, email: config.brevo.sender.email }, | ||
+ allowedRedirectUrl: config.brevo.allowedRedirectUrl, | ||
}; | ||
} | ||
}, | ||
BrevoContactAttributes, | ||
BrevoContactFilterAttributes, | ||
- allowedRedirectUrl: config.brevo.allowedRedirectUrl, | ||
}, | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters