Skip to content

Commit

Permalink
Prevent invisible blocks from being included in the newsletter (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasdax98 authored Sep 3, 2024
1 parent 760aff5 commit 799366c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/moody-pumas-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@comet/brevo-api": patch
---

Prevent invisible blocks from being included in the newsletter
5 changes: 4 additions & 1 deletion packages/api/src/email-campaign/email-campaigns.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ export class EmailCampaignsService {
}

async saveEmailCampaignInBrevo(campaign: EmailCampaignInterface, scheduledAt?: Date): Promise<EmailCampaignInterface> {
const content = await this.blockTransformerService.transformToPlain(campaign.content);
const content = await this.blockTransformerService.transformToPlain(campaign.content, {
includeInvisibleContent: false,
previewDamUrls: false,
});

const { data: htmlContent, status } = await this.httpService.axiosRef.post(
this.config.emailCampaigns.frontend.url,
Expand Down

0 comments on commit 799366c

Please sign in to comment.