fix(messaging): let an empty reply-to restore the default

Accept an empty string for replyToEmail so a draft can drop a custom
reply-to and fall back to the provider or sender, matching the worker's
empty-value handling.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ArnabChatterjee20kandClaude Opus 4.8 committed 2026-09-21 11:24:39 +05:30
1 parent 0b6d57a4eb
commit 828030626d
2 files changed
+3 -3

No files matched your search

@@ -72,7 +72,7 @@ class Create extends Action
->param('cc', [], fn (Database $dbForProject) => new ArrayList(new UID($dbForProject->getAdapter()->getMaxUIDLength())), 'Array of target IDs to be added as CC.', true, ['dbForProject'])
->param('bcc', [], fn (Database $dbForProject) => new ArrayList(new UID($dbForProject->getAdapter()->getMaxUIDLength())), 'Array of target IDs to be added as BCC.', true, ['dbForProject'])
->param('attachments', [], new ArrayList(new CompoundUID()), 'Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.', true)
->param('replyToEmail', '', new Email(), 'Email address to reply to. If not set, defaults to the sender email address.', true)
->param('replyToEmail', '', new Email(allowEmpty: true), 'Email address to reply to. If not set, defaults to the sender email address.', true)
->param('replyToName', '', new Text(128), 'Name of the reply to recipient. If not set, defaults to the sender name.', true)
->param('draft', false, new Boolean(), 'Is message a draft', true)
->param('html', false, new Boolean(), 'Is content of type HTML', true)
@@ -69,8 +69,8 @@ class Update extends Action
->param('html', null, new Nullable(new Boolean()), 'Is content of type HTML', true)
->param('cc', null, fn (Database $dbForProject) => new Nullable(new ArrayList(new UID($dbForProject->getAdapter()->getMaxUIDLength()))), 'Array of target IDs to be added as CC.', true, ['dbForProject'])
->param('bcc', null, fn (Database $dbForProject) => new Nullable(new ArrayList(new UID($dbForProject->getAdapter()->getMaxUIDLength()))), 'Array of target IDs to be added as BCC.', true, ['dbForProject'])
->param('replyToEmail', null, new Nullable(new Email()), 'Email address to reply to. If not set, defaults to the sender email address.', true)
->param('replyToName', null, new Nullable(new Text(128)), 'Name of the reply to recipient. If not set, defaults to the sender name.', true)
->param('replyToEmail', null, new Nullable(new Email(allowEmpty: true)), 'Email address to reply to. Pass an empty string to restore the provider or sender default.', true)
->param('replyToName', null, new Nullable(new Text(128)), 'Name of the reply to recipient. Pass an empty string to restore the provider or sender default.', true)
->param('scheduledAt', null, new Nullable(new DatetimeValidator(requireDateInFuture: true)), 'Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.', true)
->param('attachments', null, new Nullable(new ArrayList(new CompoundUID())), 'Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.', true)
->inject('queueForEvents')