Skip to content

Add image uploads to the email editor - #182

Merged
yaseenhalabi merged 1 commit into
mainfrom
codex/email-image-uploads
Sep 9, 2026
Merged

yaseenhalabi merged 1 commit into
mainfrom
codex/email-image-uploads

Conversation

@akulsharma1

Copy link
Copy Markdown
Collaborator

The email editor currently requires authors to host images elsewhere and hand-write image tags. Add Upload & insert image to publish PNG, JPEG, or GIF banners to the existing public HackIllinois/adonix-metadata repository and insert responsive image HTML at the cursor. The preview and outgoing email use the same URL, pinned to the upload's GitHub commit so later uploads cannot replace images in sent emails.

The upload endpoint verifies the user's ADMIN role with Adonix, enforces a 5 MB limit and image signature checks, and rejects private repositories. GitHub credentials remain on the server. The editor includes alt text, a copyable hosted URL, and upload errors, and prevents sending while an upload is in progress.

Deployment requires the server-only EMAIL_IMAGES_GITHUB_TOKEN secret with Contents write access to the asset repository. Optional repository and branch overrides and local/Cloudflare setup are documented in the README. The existing bundled header/footer remain in place.

Validation:

  • Production build passed (npm run build).
  • All 13 upload tests passed (npm test), covering authorization, size/type rejection, private repositories, GitHub/network failures, and HTML escaping.
  • ESLint and Prettier checks passed for the changed files; git diff --check passed.
  • Checked the new controls and banner rendering in a local browser preview. GitHub writes were mocked in tests; no images were published and no emails were sent.

@yaseenhalabi
yaseenhalabi merged commit a2b28f5 into main Sep 9, 2026
4 checks passed
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.

2 participants