Skip to content

refactor: remove unused Customer.io transactional email codepath#1498

Open
evanjacobson wants to merge 5 commits intomainfrom
improvement/remove-customerio-email
Open

refactor: remove unused Customer.io transactional email codepath#1498
evanjacobson wants to merge 5 commits intomainfrom
improvement/remove-customerio-email

Conversation

@evanjacobson
Copy link
Contributor

@evanjacobson evanjacobson commented Mar 24, 2026

Summary

Removes the unused Customer.io transactional email codepath. Production has been on Mailgun.

  • Deleted email-customerio.ts and removed customerio-node dependency
  • Removed EMAIL_PROVIDER config and routing logic — send() always uses Mailgun
  • Simplified admin email testing page (removed provider selector, CIO variable preview)
  • Removed dead templates object (CIO template ID mapping), made subjects the single source of truth
  • Simplified creditsVars (removed CIO Liquid-only variables)

Note: external-services.ts CIO user deletion is preserved — it uses different API keys (CUSTOMERIO_SITE_ID/CUSTOMERIO_API_KEY) for marketing audience cleanup.

Verification

  • npx tsc --noEmit — no type errors
  • pnpm lint — clean
  • Verified via automated agent that this branch has zero NeverBounce contamination (9/9 checks pass)
  • Admin email testing page loads with no provider dropdown (manually tested via Playwright)

Visual Changes

Before After
Admin email testing page has Template / Provider / Recipient selectors (3-column grid) Template / Recipient only (2-column grid), no provider dropdown

Reviewer Notes

Production has been on Mailgun. Removes email-customerio.ts, customerio-node
dependency, EMAIL_PROVIDER config, and CIO provider option from admin
email testing page. CIO user deletion in external-services.ts is
preserved (different API keys, used for marketing audience cleanup).
@kilo-code-bot
Copy link
Contributor

kilo-code-bot bot commented Mar 24, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (11 files)
  • .env.development.local.example
  • .env.test
  • package.json
  • packages/trpc/dist/index.d.ts
  • pnpm-lock.yaml
  • src/app/admin/email-testing/page.tsx
  • src/lib/config.server.ts
  • src/lib/email-customerio.ts
  • src/lib/email.ts
  • src/routers/admin/email-testing-router.ts
  • src/routers/organizations/organization-members-router.test.ts

Reviewed by gpt-5.4-20260305 · 528,467 tokens

Copy link
Contributor Author

Choose a reason for hiding this comment

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

most of these will be filtered out after #1356 merges

The jest.mock for @/lib/email only provided sendOrganizationInviteEmail,
but the email-testing-router (loaded transitively via the router tree)
now imports subjects from @/lib/email at module level. Add the missing
exports to the mock.
…-Org/cloud into improvement/remove-customerio-email
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