Repository navigation
The supporter email is HTML, with an Open in Folio button - #248
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 byworker.jsand by the admin page's test payment). Not deployed yet: that is awrangler deployand needs your yes.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 thebetaandallpools, 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).folio://redeem?c=<code>.RedeemActivityhas 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 afolio://link.How I checked it
node --testintools/kofi-worker: 36 pass (29 before, 7 inemail.test.mjsand one inworker.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 shaperedeemCode()accepts, and that the worker sends both parts to Resend with the reply address.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.