Skip to content

Commit 421e3d2

Browse files
authored
add email to UserManagement.updateUser (#285)
1 parent 0f29f1e commit 421e3d2

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

lib/UserManagement.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ public function getUserByExternalId($externalId)
111111
* @param string|null $passwordHashType The algorithm originally used to hash the password. Valid values are `bcrypt`, `ssha`, and `firebase-scrypt`.
112112
* @param string|null $externalId The user's external ID.
113113
* @param array<string, string>|null $metadata The user's metadata.
114+
* @param string|null $email The email address of the user.
114115
*
115116
* @throws Exception\WorkOSException
116117
*
@@ -125,7 +126,8 @@ public function updateUser(
125126
$passwordHash = null,
126127
$passwordHashType = null,
127128
$externalId = null,
128-
$metadata = null
129+
$metadata = null,
130+
$email = null
129131
) {
130132
$path = "user_management/users/{$userId}";
131133

@@ -137,7 +139,8 @@ public function updateUser(
137139
"password_hash" => $passwordHash,
138140
"password_hash_type" => $passwordHashType,
139141
"external_id" => $externalId,
140-
"metadata" => $metadata
142+
"metadata" => $metadata,
143+
"email" => $email
141144
];
142145

143146
$response = Client::request(Client::METHOD_PUT, $path, null, $params, true);

tests/WorkOS/UserManagementTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ public function testUpdateUser()
5656
"password_hash" => null,
5757
"password_hash_type" => null,
5858
"external_id" => null,
59-
"metadata" => null
59+
"metadata" => null,
60+
"email" => null
6061
];
6162

6263
$this->mockRequest(

0 commit comments

Comments
 (0)