From 3b3c627a10b1f04963fa0846b9a40eb4c8aece3a Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Mon, 21 Sep 2026 11:30:48 +0530 Subject: [PATCH] fix(messaging): allow empty replyToName to clear the default Text defaults to a minimum length of one, so an empty replyToName was rejected. Use Text(128, 0) as the provider create actions do, letting an empty string clear the custom reply-to name. Co-Authored-By: Claude Opus 4.8 --- .../Platform/Modules/Messaging/Http/Messages/Email/Create.php | 2 +- .../Platform/Modules/Messaging/Http/Messages/Email/Update.php | 2 +- 2 files changed, 2 insertions(+), 2 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 6d5df7ed8a..6a6f719b2b 100644 --- a/src/Appwrite/Platform/Modules/Messaging/Http/Messages/Email/Create.php +++ b/src/Appwrite/Platform/Modules/Messaging/Http/Messages/Email/Create.php @@ -73,7 +73,7 @@ class Create extends Action ->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(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('replyToName', '', new Text(128, 0), '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) ->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) 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 18234a5f43..a85f96d4f0 100644 --- a/src/Appwrite/Platform/Modules/Messaging/Http/Messages/Email/Update.php +++ b/src/Appwrite/Platform/Modules/Messaging/Http/Messages/Email/Update.php @@ -70,7 +70,7 @@ class Update extends Action ->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(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('replyToName', null, new Nullable(new Text(128, 0)), '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')