From 828030626d96dac555339b3e1cd89a97784626af Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Mon, 21 Sep 2026 11:24:39 +0530 Subject: [PATCH] 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 --- .../Platform/Modules/Messaging/Http/Messages/Email/Create.php | 2 +- .../Platform/Modules/Messaging/Http/Messages/Email/Update.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Messaging/Http/Messages/Email/Create.php b/src/Appwrite/Platform/Modules/Messaging/Http/Messages/Email/Create.php index 98108e40dd..6d5df7ed8a 100644 --- a/src/Appwrite/Platform/Modules/Messaging/Http/Messages/Email/Create.php +++ b/src/Appwrite/Platform/Modules/Messaging/Http/Messages/Email/Create.php @@ -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 :.', 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) diff --git a/src/Appwrite/Platform/Modules/Messaging/Http/Messages/Email/Update.php b/src/Appwrite/Platform/Modules/Messaging/Http/Messages/Email/Update.php index ab84c7324b..18234a5f43 100644 --- a/src/Appwrite/Platform/Modules/Messaging/Http/Messages/Email/Update.php +++ b/src/Appwrite/Platform/Modules/Messaging/Http/Messages/Email/Update.php @@ -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 :.', true) ->inject('queueForEvents')