From 34075370ba786435f075f4a008f6d5fd6258e8f9 Mon Sep 17 00:00:00 2001 From: raphaelblum <44967610+raphaelblum@users.noreply.github.com> Date: Fri, 9 Aug 2024 14:18:16 +0200 Subject: [PATCH] Add id to the POST request to enable applications to add a browserUrl to render the email (#69) --- .changeset/witty-pots-repair.md | 5 +++++ packages/api/src/email-campaign/email-campaigns.service.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/witty-pots-repair.md diff --git a/.changeset/witty-pots-repair.md b/.changeset/witty-pots-repair.md new file mode 100644 index 00000000..e55e887d --- /dev/null +++ b/.changeset/witty-pots-repair.md @@ -0,0 +1,5 @@ +--- +"@comet/brevo-api": minor +--- + +Add `id` to the POST request to the mailing frontend, enabling applications to use the `id` to generate a `browserUrl` for rendering the email in a web browser. diff --git a/packages/api/src/email-campaign/email-campaigns.service.ts b/packages/api/src/email-campaign/email-campaigns.service.ts index 6460ef7f..3edf55a1 100644 --- a/packages/api/src/email-campaign/email-campaigns.service.ts +++ b/packages/api/src/email-campaign/email-campaigns.service.ts @@ -47,7 +47,7 @@ export class EmailCampaignsService { const { data: htmlContent, status } = await this.httpService.axiosRef.post( this.config.emailCampaigns.frontend.url, - { title: campaign.title, content, scope: campaign.scope }, + { id: campaign.id, title: campaign.title, content, scope: campaign.scope }, { headers: { "Content-Type": "application/json" }, auth: {