Repository navigation
fix: allow a Reply-To email on any domain - #591
Open
mikkelsvartveit wants to merge 2 commits into
Open
mikkelsvartveit wants to merge 2 commits into
mikkelsvartveit wants to merge 2 commits into
Conversation
The Reply-To field reused the From field's input, which only offers verified domains. Only the From address needs a verified domain, and the API already accepts any Reply-To address, so use a plain email input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dashboard now takes Reply-To as free text, and its floating save bar skips the browser's form validation, so check the address on the server. Template create and update and campaign update now return 400 for a Reply-To that is not an email address. Empty values are still allowed. Campaign create already validates it through CampaignSchemas.create. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Description
The Reply-To field on templates and campaigns reused
EmailDomainInput, the same input as the From field. That input only lets you pick a verified domain from a dropdown, so you can't set a Reply-To address on another domain, such as a support inbox or a shared helpdesk address.Only the From address needs a verified domain:
DomainService.verifyEmailDomainonly checksfrom, and/v1/sendalready accepts anyreplyaddress. So this was a dashboard-only limitation.Dashboard (
EmailSettings.tsx): the Reply-To field is now a plaintype="email"input.API: with free text, a typo could now be saved. The browser's email validation only runs on the form's submit button, while the floating
StickySaveBarcallshandleSavedirectly. So the server now checks it:assertValidReplyToinutils/templateValidation.ts, next toassertValidTemplateSyntax. It returns 400 "Reply-To must be a valid email address" for a non-empty value that isn't an email address.fromdomain check.CampaignSchemas.create.nullvalues are still allowed, so existing API clients that send an empty Reply-To keep working.Type of Change
feat:New feature (MINOR version bump)fix:Bug fix (PATCH version bump)feat!:Breaking change - new feature (MAJOR version bump)fix!:Breaking change - bug fix (MAJOR version bump)docs:Documentation update (no version bump)chore:Maintenance/dependencies (no version bump)refactor:Code refactoring (no version bump)test:Adding tests (no version bump)perf:Performance improvement (PATCH version bump)Testing
Run locally against Postgres 16, Redis 7 and MinIO, with the same environment as
ci.yml:yarn test:run: 80 files, 1683 tests pass, including 4 newassertValidReplyTotestsyarn lint: 0 errors, and no new warningsyarn build --filter=api --filter=websucceeds, andtsc --noEmitpasses forapiandwebManually, with the API and dashboard dev servers and a project with a verified domain:
hello@<verified domain>and Reply-Tosupport@other-domain.example. It saved, and the edit page shows the address after a reload.still-not-an-emailshows "Reply-To must be a valid email address" and doesn't save.null, and the placeholder shows the From address.nullreturns 200. The campaign edit page shows the new field with the saved address.Checklist
Related Issues
Related to #228, which asked for a configurable Reply-To in the UI.