SSWConsulting / SSWConsulting/SSW.Website

🗞️ Newsletters - Automate the upload flow (use email tool's hosted URL)

Open
#4,702 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
14
Forks
10
Avg merge
13h 51m
Merged PRs (30d)
38

Description

Background

The newsletter upload flow is still painful for marketing (Penny) three years after it was first flagged. Picking up the thread from a stack of prior issues:

  • #626 — Newsletters - Upload file feature on TinaCMS (Gilles, May 2023, closed by Harry's #821)
  • #712 — 📄🎥 Newsletters - How to upload? (Brady, Jul 2023, still OPEN; Harry recorded the demo video below)
  • #821 — ✨Newsletters - File Upload on TinaCMS (Harry, shipped the Tina upload UI)
  • #1070 — 🐛 Newsletter wont upload to Tina (Penny, still OPEN)

📺 Harry's demo video for Penny: https://youtu.be/lrgF3T7Y0Qs

📝 Full findings doc (in branch chore/pin-and-update-deps): _docs/NEWSLETTER_AUTOMATION_FINDINGS.md (will land in its own PR)

Adam's feedback on #712 already pointed at the right answer two years ago: "Now you would send it with MailChimp or Campaign Monitor or Sendgrid?" — yes, exactly that.

Current process

  1. Marketing edits an HTML template (hand-coded, <!-- EDIT HERE --> markers)
  2. Save as _YYYY_MM__Title__.html (rigid underscore convention)
  3. Upload into public/images/newsletter-uploads/<YYYY>/
  4. Run scripts/fix_newsletter_images.py (rewrites case-mismatched <img> paths)
  5. Run scripts/fix-newsletter-titles.py (needs Azure AI credentials to de-dupe <title> tags)
  6. Open Tina /admin → add row to content/newsletters/_<YYYY>.json (month, file path, description)
  7. Commit / PR / deploy
  8. Send the actual email via Dynamics 365 (Customer Insights – Journeys) — repo isn't even the source of truth for the sent email

Pain points

  • Brittle filename convention; easy to break
  • content/newsletters/_2025.json line 31 has %2520 (double-encoded space) from manual entry
  • Description drifts across three places (JSON / filename / <title>) — Mar 2025 says "Why Rules are Cool" in JSON but the filename says "…The Secret to Smarter Teams"
  • Two Python scripts a non-dev must run locally; one needs Azure AI credentials
  • No append helper — _2025.json has months in random order
  • HTML template authoring with <!-- EDIT HERE --> markers is itself a friction point upstream
  • Tina upload was supposed to fix this (#821) but failed for Penny (#1070); the issue was never closed

Why all this exists

We're hosting a second copy of an email that's already authored, stored, and hosted by Dynamics 365. Every major email tool — Dynamics 365 Customer Insights, Mailchimp, Campaign Monitor, HubSpot, Brevo — produces a permanent public "view in browser" URL per campaign. Storing that URL in Tina (instead of a hand-crafted HTML file) collapses steps 1–6 above.

Recommended path

Path 1 — Use the email tool's archive URL (smallest, fastest):

- file:        image upload   (HTML, requires fix-up scripts)
+ archiveUrl:  string         (paste the "view in browser" URL after sending)

NewslettersTable renders <a href={archiveUrl} target="_blank"> per row. Existing newsletters stay as static files in /newsletter-uploads/; schema accepts both file and archiveUrl during migration.

  • Cost: ~½ day dev work
  • Friction per newsletter after: ~5 seconds (paste one URL)
  • Blocker: confirm Dynamics produces a stable public archive URL per campaign

If marketing is open to migrating away from hand-coded HTML, Path 2 (move sending to Mailchimp's drag-and-drop editor, then Path 1) is the better long-term answer. Adam suggested this in 2023.

Cleanup to bundle into the same PR (whichever path)

  • Fix the %2520 double-encoding bug in _2025.json (Feb entry)
  • Decide whether description is source-of-truth in JSON or derived from the HTML/campaign subject
  • Document the kept-or-killed status of scripts/fix_newsletter_images.py and scripts/fix-newsletter-titles.py
  • Close #712 and #1070 as resolved-by-this-issue (or roll their tasks in)

Open questions for Adam / marketing

  1. Confirm the email tool is Dynamics 365 Customer Insights – Journeys.
  2. Does each Dynamics campaign produce a public "view as web page" URL we can link to?
  3. Any policy reason the newsletter HTML must live on ssw.com.au rather than the email tool's domain? (SEO: could mitigate with a redirect ssw.com.au/newsletters/2025/07 → archive URL.)
  4. Keep existing /images/newsletter-uploads/... URLs live forever? (Yes by default — archive integrity.)

cc @adamcogan @PennyWalker

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the newsletter data in content/newsletters/_2025.json and the NewslettersTable rendering path, then review scripts/fix_newsletter_images.py and scripts/fix-newsletter-titles.py. Confirm with marketing whether Dynamics 365 provides a stable public archive URL before changing the schema. Done means new rows can use archiveUrl while existing file-based newsletters and their URLs continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, nextjs, python
Domain
content, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.