Skip to content

The supporter email is HTML, with an Open in Folio button - #248

Merged
McCal-Codes merged 1 commit into
mainfrom
supporter-email
Oct 2, 2026
Merged

McCal-Codes merged 1 commit into
mainfrom
supporter-email

Conversation

@McCal-Codes

Copy link
Copy Markdown
Owner

What this changes

The email the worker sends with a supporter's code is now HTML as well as plain text (tools/kofi-worker/email.js, used by worker.js and by the admin page's test payment). Not deployed yet: that is a wrangler deploy and needs your yes.

  • A teal header with the Folio icon (the one image, from foliolauncher.com/icon.png), "Thank you, .", the code in a boxed monospace block four groups to a line, the Settings › Supporter › Redeem a Code line, the beta line for the beta and all pools, your closing line, and a small footer ("You are getting this because you supported Folio. Reply to this email to reach me." plus links to foliolauncher.com and the repository).
  • An Open in Folio button that links to folio://redeem?c=<code>. RedeemActivity has handled that link since 0.6.5, so it needs no app change and no release: on an Android phone with Folio it adds the code in one tap, and it refuses to replace a code someone already holds. The plain text carries the same link, and the paste-it-in instructions stay under the button for any mail app that won't open a folio:// link.
  • A dark version for Apple Mail and the Gmail app, and a narrow-screen layout. Every text color is at least 5.2:1 against its background.
  • Your words are unchanged, with one edit: the sign-off is "McCal", not "— McCal", because of your no-em-dash rule. The words I added are the footer and "On your Android phone, this adds the code in one tap."
  • The name Ko-fi passes on is typed by the supporter, so it is HTML-escaped; a test covers a name made of markup.
  • The plain-text part is still sent, as before.

How I checked it

  • node --test in tools/kofi-worker: 36 pass (29 before, 7 in email.test.mjs and one in worker.test.mjs). They check the words, the escaping, that the HTML has no script and reaches no host but foliolauncher.com and github.com, that the link has the shape redeemCode() accepts, and that the worker sends both parts to Resend with the reply address.
  • Looked at it in the Mockup Lab in light and dark, wide and phone width.
  • Not checked: how it looks in Gmail, Outlook or Apple Mail, or whether Gmail opens a folio:// link from an email (some mail apps strip custom schemes). The test send after deploy is how to find out. If Gmail won't open it, the fix is an https page on foliolauncher.com that hands the code to Folio; that is a site change and not in this PR.

Next

Deploy the worker, then use the admin page's Test payment with your address and tap Open in Folio on your phone. These tests aren't part of CI, and I did not add them to it.

Cheap way out: revert this commit; the old text email comes back.

  • No GPL code and nothing that needs root
  • No app change, so no CHANGELOG line (REL-7 skipped)

@McCal-Codes
McCal-Codes merged commit a50a5c1 into main Oct 2, 2026
3 checks passed
@McCal-Codes
McCal-Codes deleted the supporter-email branch October 2, 2026 18:47
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