Skip to content

Add the Newsletters content type and the Post Roundup block - #204

Draft
phpbits wants to merge 11 commits into
mainfrom
feature/19814728-post-roundup-block
Draft

phpbits wants to merge 11 commits into
mainfrom
feature/19814728-post-roundup-block

Conversation

@phpbits

@phpbits phpbits commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

What this adds

A separate Newsletters content type and a Post Roundup block, so an author can write a newsletter in WordPress, never publish it on the site, and send it to beehiiv.

Teamwork task 19814728.

Newsletters content type (beehiiv_newsletter)

  • Non-public: no permalink, and it stays out of queries, search, sitemaps and RSS. Anonymous REST reads return 401.
  • Block editor, with the same block mapping as posts. The beehiiv sidebar panel (publication, template, send or schedule) works, and "Send to newsletter" is on by default.
  • beehiiv > Newsletters list with title, beehiiv status, date and author. The status comes from data WordPress already stores, with no API call per row.
  • The beehiiv menu opens to anyone who can publish posts, and Settings stays administrator-only. Non-administrators land on Newsletters.
  • New newsletters start with one Post Roundup block (not locked).
  • The email preview works for newsletters.
  • One shared list of supported types (ContentTypes) replaces the post-only checks in the sender, test sender, editor settings and preview.

Post Roundup block (beehiiv/post-roundup, newsletters only)

  • Automatic: the latest published posts, newest first, count 1 to 10. Manual: posts picked with the 10up ContentPicker and reordered.
  • Display toggles for the featured image, title, excerpt and Read more button.
  • Card edits: the title, excerpt, button label and image can be edited per card for this newsletter. They are stored on the block by post ID, and the source post is never changed. Edits are plain text.
  • Layout: Full, 50:50, 30:70 or 70:30 with the image on the left or right. A split card is sent as a beehiiv columns block, top-aligned.
  • The block is dynamic. At send it expands into image, paragraph, button and separator blocks, so the preview and the sent newsletter use the same resolver.
  • Automatic lists freeze when the author sends or schedules, so a scheduled send goes out with the list the author scheduled.
  • Works inside Columns and Group blocks. Inside a column, cards are sent full width with no separators, because a beehiiv column cannot hold another columns block.

Notes for review

  • New dependency: @10up/block-components 1.23.0. typescript is pinned to ^5.9.3 because TypeScript 7 broke lint:js.
  • The block script is about 583 KiB minified (136 KB gzipped) and loads on every block-editor screen, because ContentPicker pulls in several libraries. Lazy-loading the picker would reduce it.
  • Not covered by tests: keyboard reordering in the picker, scheduled sends, and a real send to beehiiv. Everything was tested against a mocked API.
  • Layout and nesting have been checked in the preview on a connected site, but not every combination against the live API. A columns block inside a Group section, for example, is not verified.
  • Decisions to confirm are listed as open questions in the PRDs: Q-001 to Q-008 in the Newsletters PRD and Q-001 to Q-008 in the Post Roundup PRD.

Testing

  • PHPUnit: 269 tests, 892 assertions.
  • Playwright (wp-env tests site): newsletters spec 10 of 10, post roundup spec 12 of 12, menu spec 5 of 5.
  • lint:js, lint:css and lint:php are clean.
  • Main (Release 1.2.0) is merged into this branch. Two conflicts, in Plugin.php and Sender.php, kept both sides.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant