Skip to content

Commit 9ddc901

Browse files
committed
Swap var names
1 parent d470032 commit 9ddc901

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/ApiClient.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -327,21 +327,21 @@ public function getBookVariables($id)
327327
*
328328
* @param int $bookID
329329
* @param string $email User email
330-
* @param array $data User vars in [key=>value] format
330+
* @param array $vars User vars in [key=>value] format
331331
* @return stdClass
332332
*/
333-
public function updateEmailVariables(int $bookID, string $email, array $data)
333+
public function updateEmailVariables(int $bookID, string $email, array $vars)
334334
{
335335
if (empty($bookID)) {
336336
return $this->handleError('Empty book id');
337337
}
338338

339-
$vars = ['email' => $email, 'variables' => []];
340-
foreach ($data as $name => $val) {
341-
$vars['variables'][] = ['name' => $name, 'value' => $val];
339+
$data = ['email' => $email, 'variables' => []];
340+
foreach ($vars as $name => $val) {
341+
$data['variables'][] = ['name' => $name, 'value' => $val];
342342
}
343343

344-
$requestResult = $this->sendRequest('/addressbooks/' . $bookID . '/emails/variable', 'POST', $vars);
344+
$requestResult = $this->sendRequest('/addressbooks/' . $bookID . '/emails/variable', 'POST', $data);
345345

346346
return $this->handleResult($requestResult);
347347
}

0 commit comments

Comments
 (0)