Skip to content

Fix moderation email rendering and remove reply wording - #232

Merged
admdly merged 5 commits into
mainfrom
fix/email-template-rendering
Sep 17, 2026
Merged

admdly merged 5 commits into
mainfrom
fix/email-template-rendering

Conversation

@admdly

@admdly admdly commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #226.

Reply wording removed. There is no monitored inbox, but extension-delisted and claim-rejected invited recipients to "reply to this email" — replies went to noreply@fossbilling.org with no Reply-To set. Delisted keeps its dashboard link; claim-rejected now links the dashboard instead of inviting a reply. The EXTENSIONS_V2_EMAIL_REPLY_TO doc no longer uses noreply@… as its example, and tests no longer enshrine reply-to-noreply (prod sends no Reply-To; the forwarding path stays covered by a dedicated unit test).

Unicode rendering fixed. Live mail showed mojibake around names and moderator notes (“Smoke…”“…, —): MXroute's SMTP API hands our strings to PHPMailer with its iso-8859-1 default and offers no charset parameter, so raw UTF-8 bytes were mislabeled. Templates now emit ASCII-only subjects (diacritics stripped, punctuation mapped, remainder ?) and entity-encoded HTML bodies (&#8212;), which render identically via Resend too. Bodies are complete <html><body> documents (cleared the HTML_MIME_NO_HTML_TAG SpamAssassin flag; score went from -5.9 to -6.5) and dashboard URLs are explicit <a> anchors rather than bare text. Names pasted with their own quotes no longer double up against the label's wrapping quotes.

@admdly admdly self-assigned this Sep 17, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 17, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
api 94c55cf Commit Preview URL

Branch Preview URL
Sep 17 2026, 11:11 AM

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/services/extensions/v2/email/templates.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread test/services/extensions/v2/email.test.ts
@admdly

admdly commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

Both cubic comments addressed in c5f49ff (I don't have permission to resolve the threads — please resolve if you're happy):

  • P2 (names folded in body): valid — fixed. buildModerationEmail now builds a separate displayLabel (original characters, line breaks flattened, pasted quotes stripped) for body paragraphs, while the ASCII-folded subjectLabel is used for subjects only. Covered by extended/new tests (José/CJK names round-trip correctly).
  • P3 (missing negative reply_to assertion): valid — added expect(body.reply_to).toBeUndefined() to the "posts the SMTP API payload" test, which uses the reply-To-less default config.

Checks: typecheck, lint, Prettier clean; 86/86 tests pass across email, moderation-notify, and moderation suites.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread test/services/extensions/v2/email.test.ts
@admdly

admdly commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

New P2 addressed in 94c55cf (again, please resolve the thread — no permission on my token):

  • The CJK test now asserts the exact entity-encoded name in the HTML body (&#8220;&#26481;&#20140; Dev&#8221; (tokyo-dev)) instead of only rejecting raw characters, so a template that dropped the name would fail. Kept the negative assertion too as an ASCII-safety guard.

Also rebased onto your main merge (wrangler 4.131.2) — checks re-run after reinstall: typecheck, lint, Prettier clean; 86/86 pass.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Auto-approved: Fixes moderation email rendering (ASCII-safe subjects, entity-encoded HTML, explicit dashboard links) and stops inviting replies or sending Reply-To when unset, with focused tests and docs updated.

Re-trigger cubic

@admdly
admdly merged commit 05d44ad into main Sep 17, 2026
9 checks passed
@admdly
admdly deleted the fix/email-template-rendering branch September 17, 2026 11:23
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