You are here

public static function SendinblueManager::getAttributeLists in SendinBlue 7

Same name and namespace in other branches
  1. 7.2 includes/sendinblue.manage.inc \SendinblueManager::getAttributeLists()

Get Attribute lists.

Return value

array An array of attributes.

1 call to SendinblueManager::getAttributeLists()
sendinblue_signup_form in includes/sendinblue_signup.admin.inc
Return a form for adding/editing a sendinblue signup form.

File

includes/sendinblue.manage.inc, line 367
Manage class file.

Class

SendinblueManager
Basic manager of module.

Code

public static function getAttributeLists() {
  $access_key = variable_get(self::ACCESS_KEY, '');
  $mailin = new SendinblueMailin(self::API_URL, $access_key);
  $response = $mailin
    ->getAttributes();
  if ($response['code'] == 'success' && is_array($response['data'])) {
    $attributes = array_merge($response['data']['normal_attributes'], $response['data']['category_attributes']);
    variable_set(self::ATTRIBUTE_LISTS, $attributes);
    return $attributes;
  }
  return array();
}