You are here

function mailchimp_get_merge_tokens in Mailchimp 7

Return an array of available user tokens.

1 call to mailchimp_get_merge_tokens()
mailchimp_admin_settings in ./mailchimp.admin.inc
implementation of hook_admin_settings

File

./mailchimp.admin.inc, line 281
Mailchimp module admin settings.

Code

function mailchimp_get_merge_tokens() {
  $out = array(
    0 => '<none>',
  );

  // grab user tokens
  $token_info = token_info();
  if (!empty($token_info['tokens']['user'])) {
    foreach ($token_info['tokens']['user'] as $key => $token) {
      $out[$key] = t('!field', array(
        '!field' => $token['name'],
      ));
    }
  }
  return $out;
}