guardian / dotcom-rendering

The Guardian web rendering service (aka DCR/DCAR)
https://www.theguardian.com
Apache License 2.0
255 stars 30 forks source link

Decouple Newsletter Sign-up Pages From Articles #9958

Open JamieB-gu opened 10 months ago

JamieB-gu commented 10 months ago

@dblatcher has a proposal to stop using Composer to generate articles that act as newsletter sign-up pages, and instead generate these pages dynamically using the newsletters API.

This would require changes on the Content Production side to alter how these pages are created, and changes on the platforms side (WebX, AppsX) to handle these pages in a different way.

dblatcher commented 10 months ago

Current Process

issues with current process

Proposal

Instead of publishing pseudo articles in composer and, we could have a dedicated feature to generate data-driven sign-up pages based only on data in the newsletter api.

When the feature is working:

Side Benefits

It is a general issue that adding/managing pages which are neither Articles or Fronts is difficult and can require obscure workarounds, hard coding and/or custom code in frontend.

This work could provide a test case for generalising page modeling in DCAR platforms and be used a a basis for 'regularising' features like:

dblatcher commented 10 months ago

Possible Dataflow / workflow for data-driven newsletter pages

flowchart TD
Z((Reader))
X((Staff))
B[[Newsletters Tool]]
A[[Newsletters API]]

C[[Frontend]]

D[[DCR]]     
C1[page model]

X <-.edit newsletter data .->B
B .->A
A -.publish\nnewsletters \ndata.->C
C -. cache\nnewsletters.->C

Z --1. request-->C
C --2. handle request-->C1
C1--3. render request--> D
D --4. rendered page-->C
C--5. response---->Z
dblatcher commented 10 months ago

Examples of existing pages https://www.theguardian.com/global/2022/sep/20/sign-up-for-the-first-edition-newsletter-our-free-news-email https://www.theguardian.com/global/2022/sep/20/sign-up-for-the-down-to-earth-newsletter-our-free-environmental-email

Proof of concept branches https://github.com/guardian/dotcom-rendering/tree/dblatcher-newsletter-detail-pages https://github.com/guardian/frontend/tree/dblatcher/newsletter-detail-pages