Skip to content

Commit

Permalink
Merge main into next (#84)
Browse files Browse the repository at this point in the history
* Prevent invisible blocks from being included in the newsletter (#80)

* Add workflow to merge main into next (#79)

---------

Co-authored-by: Thomas Dax <[email protected]>
  • Loading branch information
vivid-planet-bot and thomasdax98 authored Sep 3, 2024
1 parent 760aff5 commit 6d83768
Show file tree
Hide file tree
Showing 3 changed files with 54 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
45 changes: 45 additions & 0 deletions .github/workflows/main-into-next-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Create "Merge main into next" PR
on:
push:
branches:
- main
jobs:
main-into-next:
name: Create "Merge main into next" PR
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed to also fetch next branch

- name: Setup Git user
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Try automatic merge of main into next
id: automatic-merge-attempt
continue-on-error: true
run: |
git checkout next
git merge main
echo 'PR_TITLE=Merge main into next' >> $GITHUB_ENV
echo 'PR_BODY=This is an automated pull request to merge changes from `main` into `next`.' >> $GITHUB_ENV
- name: Merge with conflicts if automatic merge failed
if: steps.automatic-merge-attempt.outcome == 'failure' && steps.automatic-merge-attempt.conclusion == 'success' # https://docs.github.com/en/actions/learn-github-actions/contexts#steps-context
run: |
git add .
git commit -m "Merge main into next"
echo 'PR_TITLE=[Conflicts] Merge main into next' >> $GITHUB_ENV
echo 'PR_BODY=This is an automated pull request to merge changes from `main` into `next`. It has merge conflicts. To resolve conflicts, check out the branch `merge-main-into-next` locally, make any necessary changes to conflicting files, and commit and publish your changes.' >> $GITHUB_ENV
- name: Create pull request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.VIVID_PLANET_BOT_TOKEN }}
title: ${{ env.PR_TITLE }}
body: ${{ env.PR_BODY }}
base: next
branch: merge-main-into-next
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 6d83768

Please sign in to comment.