getbrevo / brevo-php

A fully-featured PHP API client to interact with Brevo.
https://developers.brevo.com/
MIT License
51 stars 23 forks source link

Importing attributes failed on \Brevo\Client\Model\CreateContact() #37

Open draghetto84 opened 3 months ago

draghetto84 commented 3 months ago

When I put attributes on CreateContact instance they're skipped and not imported. Following my partial code:

$attribs = new \stdClass(); $attribs->FNAME = "Roger"; $attribs->LNAME = "White";

$createContact = new \Brevo\Client\Model\CreateContact(); $createContact->setEmail('example@example.com'); $createContact->setListIds([2]); $createContact->setAttributes($attribs); $createContact->setUpdateEnabled (true);

try { $result = $apiInstance->createContact($createContact); print_r($result); } catch (Exception $e) { print_r($e); echo 'Exception when calling ContactsApi->createContact: ', $e->getMessage(), PHP_EOL; }

the contact creation was successfully but without attributes. I only see the email in Brevo dashboard.