-
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.
Merge pull request #45 from vivid-planet/add-brevo-configuration
Add brevo configuration
- Loading branch information
Showing
30 changed files
with
775 additions
and
40 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,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 | ||
``` |
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
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,9 @@ | ||
import { Migration } from "@mikro-orm/migrations"; | ||
|
||
export class Migration20240527112204 extends Migration { | ||
async up(): Promise<void> { | ||
this.addSql( | ||
'create table "BrevoConfig" ("id" uuid not null, "createdAt" timestamp with time zone not null, "updatedAt" timestamp with time zone not null, "scope_domain" text not null, "scope_language" text not null, "senderMail" text not null, "senderName" text not null, constraint "BrevoConfig_pkey" primary key ("id"));', | ||
); | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
packages/admin/src/brevoConfiguration/BrevoConfigForm.gql.ts
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,59 @@ | ||
import { gql } from "@apollo/client"; | ||
|
||
export const brevoConfigFormFragment = gql` | ||
fragment BrevoConfigForm on BrevoConfig { | ||
senderMail | ||
senderName | ||
} | ||
`; | ||
|
||
export const brevoConfigFormQuery = gql` | ||
query BrevoConfigForm($scope: EmailCampaignContentScopeInput!) { | ||
brevoConfig(scope: $scope) { | ||
id | ||
updatedAt | ||
...BrevoConfigForm | ||
} | ||
} | ||
${brevoConfigFormFragment} | ||
`; | ||
|
||
export const brevoConfigFormCheckForChangesQuery = gql` | ||
query BrevoConfigFormCheckForChanges($scope: EmailCampaignContentScopeInput!) { | ||
brevoConfig(scope: $scope) { | ||
updatedAt | ||
} | ||
} | ||
`; | ||
|
||
export const createBrevoConfigMutation = gql` | ||
mutation CreateBrevoConfig($scope: EmailCampaignContentScopeInput!, $input: BrevoConfigInput!) { | ||
createBrevoConfig(scope: $scope, input: $input) { | ||
id | ||
updatedAt | ||
...BrevoConfigForm | ||
} | ||
} | ||
${brevoConfigFormFragment} | ||
`; | ||
|
||
export const updateBrevoConfigMutation = gql` | ||
mutation UpdateBrevoConfig($id: ID!, $input: BrevoConfigUpdateInput!, $lastUpdatedAt: DateTime) { | ||
updateBrevoConfig(id: $id, input: $input, lastUpdatedAt: $lastUpdatedAt) { | ||
id | ||
updatedAt | ||
...BrevoConfigForm | ||
} | ||
} | ||
${brevoConfigFormFragment} | ||
`; | ||
|
||
export const sendersSelectQuery = gql` | ||
query SendersSelect { | ||
senders { | ||
id | ||
name | ||
} | ||
} | ||
`; |
Oops, something went wrong.