You are here

function _mailchimp_load_user_list_mergevars in Mailchimp 5.2

Same name and namespace in other branches
  1. 5 mailchimp.module \_mailchimp_load_user_list_mergevars()
  2. 6.2 mailchimp.module \_mailchimp_load_user_list_mergevars()
  3. 6 mailchimp.module \_mailchimp_load_user_list_mergevars()
  4. 7 mailchimp.module \_mailchimp_load_user_list_mergevars()

Get the relevent merge vars for the given user for the given list

3 calls to _mailchimp_load_user_list_mergevars()
mailchimp_bio_nodeapi in ./mailchimp_bio.module
Implementation of hook_nodeapi(). Allows update on bio change
mailchimp_cron in ./mailchimp.module
Implementation of hook_cron. Resubscribes all users to the required lists if the user has chosen to do so.
mailchimp_user in ./mailchimp.module

File

./mailchimp.module, line 670

Code

function _mailchimp_load_user_list_mergevars($uid, $list_id, $mergevars) {
  $account = mailchimp_get_merge_values($uid);
  $uservars = array(
    'EMAIL' => $account['mail'],
  );
  foreach ($mergevars as $mergevar) {
    if ($key = variable_get('mailchimp_list_' . $list_id . '_merge_' . $mergevar['tag'], '')) {
      $uservars[$mergevar['tag']] = $account[$key];
    }
  }
  return $uservars;
}