619ea13649
## Twenty for Twenty: Resend module Introduces `packages/twenty-apps/internal/twenty-for-twenty`, the official internal Twenty app, with a first module integrating [Resend](https://resend.com). ### Breakdown **Resend module** (`src/modules/resend/`) - Two app variables: `RESEND_API_KEY` and `RESEND_WEBHOOK_SECRET`. - **Objects**: `resendContact`, `resendSegment`, `resendTemplate`, `resendBroadcast`, `resendEmail`, with relations between them and to standard `person`. - **Inbound sync (Resend → Twenty)**: - Cron-driven logic function `sync-resend-data` (every 5 min) pulling all entities through paginated, rate-limit-aware utilities (`sync-contacts`, `sync-segments`, `sync-templates`, `sync-broadcasts`, `sync-emails`). - Webhook endpoint (`resend-webhook`) verifying signatures and handling `contact.*` and `email.*` events in real time. - `find-or-create-person` auto-links Resend contacts to Twenty people by email. - **Outbound sync (Twenty → Resend)**: DB-event logic functions for `contact.created/updated/deleted` and `segment.created/deleted`, with a `lastSyncedFromResend` field for loop prevention. - **UI**: views, page layouts, navigation menu items, and front components (`HtmlPreview`, `RecordHtmlViewer`) to preview email/template HTML in record pages; `sync-resend-data` command exposed as a front component. ### Setup See the new README for install steps, webhook configuration, and local testing with the Resend CLI.
43 lines
997 B
YAML
43 lines
997 B
YAML
name: CD
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
types: [labeled]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
TWENTY_DEPLOY_URL: http://localhost:3000
|
|
|
|
concurrency:
|
|
group: cd-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
deploy-and-install:
|
|
if: >-
|
|
github.event_name == 'push' ||
|
|
(github.event_name == 'pull_request' && github.event.label.name == 'deploy')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
|
|
- name: Deploy
|
|
uses: twentyhq/twenty/.github/actions/deploy-twenty-app@main
|
|
with:
|
|
api-url: ${{ env.TWENTY_DEPLOY_URL }}
|
|
api-key: ${{ secrets.TWENTY_DEPLOY_API_KEY }}
|
|
|
|
- name: Install
|
|
uses: twentyhq/twenty/.github/actions/install-twenty-app@main
|
|
with:
|
|
api-url: ${{ env.TWENTY_DEPLOY_URL }}
|
|
api-key: ${{ secrets.TWENTY_DEPLOY_API_KEY }}
|