Skip to content

Commit

Permalink
Merge pull request #262 from vivid-planet/next
Browse files Browse the repository at this point in the history
Merge next into main for v3
  • Loading branch information
thomasdax98 authored Jan 21, 2025
2 parents b0aa275 + 6ea53d0 commit 77ced35
Show file tree
Hide file tree
Showing 163 changed files with 8,288 additions and 5,205 deletions.
10 changes: 10 additions & 0 deletions .changeset/fast-weeks-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@comet/brevo-api": major
---

Make this package compatible with [COMET v7](https://docs.comet-dxp.com/docs/migration/migration-from-v6-to-v7)

**Breaking Changes**:

- Now requires >= v7.5.0 for `@comet` packages
- Now requires >= 5.9.8 for `@mikro-orm` packages (except `@mikro-orm/nestjs` where >= 5.2.3 is required)
8 changes: 8 additions & 0 deletions .changeset/funny-glasses-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@comet/brevo-admin": minor
"@comet/brevo-api": minor
---

Add field for `doubleOptInTemplateId` to `BrevoConfigPage`

The environment variable BREVO_DOUBLE_OPT_IN_TEMPLATE_ID can be removed, as it is now available as a maintainable variable in the admin interface.
23 changes: 23 additions & 0 deletions .changeset/happy-cups-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
"@comet/brevo-api": major
---

Refactor `email-campaign` and `target-group` entity

Use `createEmailCampaignEntity` for creating `email-campaign` entity. Pass `EmailCampaignContentBlock`, `Scope` and `TargetGroup`.

Use `createTargetGroupEntity` for creating `target-group` entity. Pass `Scope` and optional `BrevoFilterAttributes`

Pass both to the `AppModule`:

````diff
BrevoModule.register({
brevo: {
//...
+ EmailCampaign
+ TargetGroup
}
//...
});
```
````
19 changes: 19 additions & 0 deletions .changeset/many-lamps-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
"@comet/brevo-admin": major
"@comet/brevo-api": major
---

Refactor brevo contact import to upload files to public uploads temporarily

The files for the brevo contact import now get temporarily stored in the public uploads until the import is concluded.
This change prepares for future imports to be handled in a separate job, allowing more than 100 contacts to be imported without exhausting api resources or blocking the event loop.

It is now necessary to import the `PublicUploadsModule` in the project's `AppModule` and configure it to accept csv files.

```ts
PublicUploadModule.register({
acceptedMimeTypes: ["text/csv"],
maxFileSize: config.publicUploads.maxFileSize,
directory: `${config.blob.storageDirectoryPrefix}-public-uploads`,
}),
```
9 changes: 9 additions & 0 deletions .changeset/nervous-rats-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@comet/brevo-mail-rendering": major
"@comet/brevo-admin": major
"@comet/brevo-api": major
---

Add `mail-rendering` package for providing reuseable components for rendering emails

Add new `NewsletterImageBlock`
6 changes: 6 additions & 0 deletions .changeset/new-cobras-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@comet/brevo-admin": minor
"@comet/brevo-api": minor
---

Add `folderId` to `BrevoConfig` to allow overwriting the default folderId `1`
6 changes: 6 additions & 0 deletions .changeset/short-feet-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@comet/brevo-admin": patch
"@comet/brevo-api": patch
---

Remove the `totalContactsBlocked` field from the `TargetGroup` type, because it is not delivered in the list request in Brevo anymore.
20 changes: 20 additions & 0 deletions .changeset/silly-seals-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
"@comet/brevo-admin": major
"@comet/brevo-api": minor
---

A required brevo config page must now be generated with `createBrevoConfigPage`.
All necessary brevo configuration (for each scope) must be configured within this page for emails campaigns to be sent.

```diff
+ const BrevoConfigPage = createBrevoConfigPage({
+ scopeParts: ["domain", "language"],
+ });
```

Env vars containing the brevo sender information can be removed.

```diff
- BREVO_SENDER_NAME=senderName
- BREVO_SENDER_EMAIL=senderEmail
```
17 changes: 17 additions & 0 deletions .changeset/twelve-games-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@comet/brevo-api": major
"@comet/brevo-admin": minor
---

Add a brevo configuration field for `allowedRedirectionUrl`
Env vars containing this information can be removed and must be removed from the brevo module configuration.

```diff
BrevoModule.register({
brevo: {
- allowedRedirectionUrl: config.brevo.allowedRedirectionUrl,
//...
},
//..
})
```
6 changes: 6 additions & 0 deletions .changeset/weak-points-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@comet/brevo-admin": minor
"@comet/brevo-api": minor
---

Add a brevo configuration field for `unsubscriptionPageId`
25 changes: 25 additions & 0 deletions .changeset/witty-coats-perform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
"@comet/brevo-admin": major
---

Define `scopeParts` in `BrevoConfig`

Previously the `scopeParts` were passed to the functions:

- createBrevoContactsPage
- createTargetGroupsPage
- createEmailCampaignsPage
- createBrevoConfigPage

Now they are defined once in the `BrevoConfig`:

```tsx
<BrevoConfigProvider
value={{
scopeParts: ["domain", "language"],
...otherProps,
}}
>
{children}
</BrevoConfigProvider>
```
6 changes: 2 additions & 4 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ IMGPROXY_USE_S3=false

# dam
DAM_SECRET=6a9e8a185b513363bc89ec0b96eed8f70c759bc86b97319f60365c4b7f8593dc
DAM_CDN_ENABLED="false"
DAM_CDN_DOMAIN=
DAM_CDN_ORIGIN_HEADER=

# api
API_PORT=4000
Expand Down Expand Up @@ -85,4 +82,5 @@ NEXT_PUBLIC_CAMPAIGN_IS_PREVIEW=false
REDIRECT_URL_FOR_IMPORT=$SITE_URL
BREVO_ALLOWED_REDIRECT_URL=http://${DEV_DOMAIN:-localhost}${WORKAROUND_DOTENV_ISSUE}:${SITE_PORT}
CAMPAIGNS_FRONTEND_URL=http://${DEV_DOMAIN:-localhost}${WORKAROUND_DOTENV_ISSUE}:${SITE_PORT} # doesn't work, TODO: add actual mailing frontend
BREVO_FOLDER_ID=1

SITE_PREVIEW_SECRET=8f9d7e6b4c2a1b3c
4 changes: 4 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,7 @@ jobs:
pnpm run lint
# check for duplicate ids of formatted messages
pnpm run intl:extract
# check if schema files are up to date
pnpm --filter '@comet/brevo-api' run generate-block-meta
pnpm --filter '@comet/brevo-api' run generate-schema
git diff --exit-code HEAD --
45 changes: 0 additions & 45 deletions .github/workflows/main-into-next-pr.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: dotansimha/changesets-action@cbc5ff3569ae9861100a48b290f4e9c1b94e45b5
uses: dotansimha/changesets-action@069996e9be15531bd598272996fa23853d61590e
with:
version: pnpm run version
publish: pnpm run publish
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ The attribute naming must be identical to the naming in brevo
The following variables must be set manually

- `BREVO_API_KEY`
- `BREVO_DOUBLE_OPT_IN_TEMPLATE_ID`
- `ECG_RTR_LIST_API_KEY`
- `BREVO_SENDER_NAME`
- `BREVO_SENDER_EMAIL`
- `CAMPAIGN_BASIC_AUTH_USERNAME`
- `CAMPAIGN_BASIC_AUTH_PASSWORD`

### Configure brevo sender in the demo admin brevo config page

- Brevo sender
- Brevo double opt-in template

### Start development processes

[dev-process-manager](https://github.com/vivid-planet/dev-process-manager) is used for local development.
Expand Down
1 change: 1 addition & 0 deletions copy-schema-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const fs = require("fs");
(async () => {
await Promise.all([
fs.promises.copyFile("packages/api/schema.gql", "packages/admin/schema.gql"),
fs.promises.copyFile("packages/api/block-meta.json", "packages/mail-rendering/block-meta.json"),

fs.promises.copyFile("demo/api/block-meta.json", "demo/admin/block-meta.json"),
fs.promises.copyFile("demo/api/block-meta.json", "demo/site/block-meta.json"),
Expand Down
3 changes: 2 additions & 1 deletion demo/admin/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ block-meta.json
lang-compiled/
lang/
schema.json
src/fragmentTypes.json
src/fragmentTypes.json
build/
Loading

0 comments on commit 77ced35

Please sign in to comment.