Skip to content

fix(email): send the Archera signup link from the shared CLI/web constant - #1017

Open
IAmJSD wants to merge 1 commit into
LeanerCloud:mainfrom
IAmJSD:fix/issue-48
Open

IAmJSD wants to merge 1 commit into
LeanerCloud:mainfrom
IAmJSD:fix/issue-48

Conversation

@IAmJSD

@IAmJSD IAmJSD commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Closes #48.

What and why

The approval and confirmation emails still linked to https://archera.ai/signup?mode=cudly. The CLI and the web UI link to https://www.archera.ai/cudly. The URL appeared in three places in internal/email/templates.go: the confirmation text, the approval text and the approval HTML href. All three now use common.ArcheraSignupURL.

URL chosen: https://www.archera.ai/cudly. The frontend (frontend/src/archera.ts:29) and the CLI (cmd/multi_service_stats.go, through common.ArcheraSignupURL in cloud-commitments-go pkg/common/archera.go) both use the www. form. The issue's Context section also names it; only its checklist leaves off www.

No new internal/archera constant. common.ArcheraSignupURL already exists in the pinned cloud-commitments-go, and templates.go already imports common. Using it gives the CLI, MCP and emails one Go constant. A second copy here would just be another one to keep in sync. The templates stay const and build the URL by concatenation.

Tests

  • template_renderers_test.go:438 now pins the new literal URL.
  • New archera_signup_url_test.go (the existing test file is already over 500 lines):
    • pins the literal URL for each of the three template families, and checks the old URL is gone;
    • checks both disclosures ("Optional, set up on Archera's site" and "Archera sponsors CUDly's development") are in the same Archera block as the link;
    • checks the link is left out when there's no education URL;
    • scans every non-test .go file in the package for the old URL.

Verification

All runs used AWS_CONFIG_FILE=/dev/null AWS_SHARED_CREDENTIALS_FILE=/dev/null, and no email was sent.

  • Fail-before / pass-after: before the template change, four tests failed (three new, plus the updated existing one). After it, all pass.
  • Mutation probe: I pointed the real constant at https://evil.example.com/cudly in a temp copy of the pinned module, via -modfile with a replace and GOWORK=off. The literal-pin and disclosure tests failed for all three families.
  • Build and tests: go build ./... and go vet ./... are clean. Tests pass for ./internal/email/... ./internal/archera/... ./internal/mocks/... and for the packages that import email (api, purchase, scheduler, server).
  • Lint: golangci-lint v2.10.1 reports 0 issues, and gocyclo -over 10 is clean.
  • Secrets: git-secrets on a temp copy is clean, and scripts/test-git-secrets-allowlist.sh gives 42 PASS, 0 FAIL.

Out of scope / for you

  • Stale library comment: the doc comment on common.ArcheraSignupURL in cloud-commitments-go says the email templates deliberately keep the old link, because "they may be distinct attribution paths on Archera's side". That comment becomes wrong once this merges. Is signup?mode=cudly a separate Archera attribution path worth keeping for email clicks? Align Archera signup URL in email templates with CLI/web canonical #48 asks for the switch, so I made it.
  • Disclosure constants: the emails keep their own disclosure wording rather than common.ArcheraNonGatingDisclosure / ArcheraSponsorshipDisclosure. That's unchanged.
  • Untouched: frontend/ and the CLI repo.

🤖 Generated with Claude Code

The purchase confirmation and approval request emails still linked to
https://archera.ai/signup?mode=cudly, while the CLI and web frontend
send buyers to https://www.archera.ai/cudly. Splice the link into the
templates from common.ArcheraSignupURL, the cloud-commitments-go
constant the CLI already uses, so there is one Go source of truth.

Tests pin the literal URL for every template family that embeds it
(confirmation text, approval text, approval HTML), check both
partnership disclosures stay in the same Archera block as the link,
and scan the package's template sources for the legacy URL.

Closes LeanerCloud#48

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@IAmJSD IAmJSD added priority/p2 Backlog-worthy type/chore Maintenance / non-user-visible triaged Item has been triaged severity/low Minor harm urgency/this-quarter Within the quarter impact/many Affects most users effort/s Hours labels Oct 16, 2026
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 3 billable files and costs up to $0.75.

Or wait 40 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: LeanerCloud/cloud-commitments-platform/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fad554d5-fd7f-4b65-b44f-2fe256cdd712
📥 Commits

Reviewing files that changed from the base of the PR and between 173474e and 8502f8d.

📒 Files selected for processing: 3
  • internal/email/archera_signup_url_test.go
  • internal/email/template_renderers_test.go
  • internal/email/templates.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@cristim

cristim commented Oct 16, 2026

Copy link
Copy Markdown
Member

Independent review verdict: CLEAN at 8502f8d

Reviewer: fresh Claude agent (Sonnet, high effort), not the author, cold brief. The PR body was treated as a claim. Coordinator: claude-cc-reviewer.

Blocking findings: none.

Verified:

  • All three links switched: internal/email/templates.go:127 and :668 (text) and :766 (HTML href) now use common.ArcheraSignupURL. Those are the only Archera links in non-test sources, and no other archera.ai literal remains in internal/email.
  • Same URL as the web app: the constant is defined in the pinned cloud-commitments-go pkg (common/archera.go:30) as https://www.archera.ai/cudly. That is byte-identical to frontend/src/archera.ts:29 (ARCHERA_SIGNUP_URL).
  • No escaping risk: the HTML template uses html/template, and the URL has no & or special characters.
  • Tests: the literal URL is pinned per template family (confirmation text, approval text, approval HTML). The tests also check that the link is omitted without an education URL, and that no source file still holds the legacy URL.

Owner question (product, not a code defect): the old email link was ...?mode=cudly. The library comment (common/archera.go:21-28) says the CLI/web URL was kept separate on purpose, possibly as a separate attribution path, and the PR body flags this too. Merging drops ?mode=cudly from the emails. @cristim, please confirm that is intended.

What was attacked and how:

  • go vet ./internal/email/... is clean, and go test -race -count=1 ./internal/email/... passes, including the 13 new subtests.
  • Fail-before: with the base templates.go restored, 4 tests fail.
  • Mutation probe: appending ?x=1&y=2 to the HTML href fails the HTML subtest.

Gate:

@IAmJSD
IAmJSD marked this pull request as ready for review October 16, 2026 23:32

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/s Hours impact/many Affects most users priority/p2 Backlog-worthy severity/low Minor harm triaged Item has been triaged type/chore Maintenance / non-user-visible urgency/this-quarter Within the quarter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align Archera signup URL in email templates with CLI/web canonical

2 participants