From b060bbea51325c1c6c2bcc1e1c6425e410daebf8 Mon Sep 17 00:00:00 2001 From: Sabrina Demagny Date: Thu, 12 Dec 2024 14:33:56 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(mailbox)=20fix=20activate=20mailbo?= =?UTF-8?q?x=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix 422 Unprocessable Entity error returned by dimail because of some missing data sent. --- CHANGELOG.md | 1 + src/backend/mailbox_manager/utils/dimail.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5863fea..7679860 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to ### Fixed +- 🐛(mailbox) fix activate mailbox feature - 🔧(helm) fix the configuration environment #579 ## [1.7.1] - 2024-11-28 diff --git a/src/backend/mailbox_manager/utils/dimail.py b/src/backend/mailbox_manager/utils/dimail.py index 9aac14b..e8d8b41 100644 --- a/src/backend/mailbox_manager/utils/dimail.py +++ b/src/backend/mailbox_manager/utils/dimail.py @@ -375,7 +375,12 @@ class DimailAPIClient: """Send a request to enable a mailbox to dimail API""" response = session.patch( f"{self.API_URL}/domains/{mailbox.domain.name}/mailboxes/{mailbox.local_part}", - json={"active": "yes"}, + json={ + "active": "yes", + "givenName": mailbox.first_name, + "surName": mailbox.last_name, + "displayName": f"{mailbox.first_name} {mailbox.last_name}", + }, headers=self.get_headers(user_sub), verify=True, timeout=10,