<commit_before><?php

// An event listener that handles user votes.
Event::listen('user.vote', function($candidate, $user) {
  // Sign user up for transaction messages.
  $credentials = Config::get('messagebroker.credentials');
  $config = Config::get('messagebroker.config');
  $config['routingKey'] = 'cgg.event.vote';

  $mb = new MessageBroker($credentials, $config);

  $payload = [
    // User information
    'first_name' => $user->first_name,
    'email' => $user->email,
    'mobile' => $user->phone,
    'birthdate_timestamp' => $user->birthdate_timestamp(), // Message Broker expects UNIX timestamp
    'candidate_id' => $candidate->id,
    'candidate_name' => $candidate->name,

    // Request specific information
    'activity' => 'cgg2014_vote',
    'application_id' => 201,
    'activity_timestamp' => time(),
    'email_template' => 'mb-cgg2014-vote',
    'email_tags' => [
      0 => 'cgg2014_vote',
    ],
    'mailchimp_grouping_id' => '10621',
    'mailchimp_group_name' => 'CelebsGoneGood2014',
    'mc_opt_in_path_id' => '174269',
    'merge_vars' => [
      'FNAME' => $user->first_name
    ]
  ];

  $payload = serialize($payload);
  $mb->publishMessage($payload);

});

Event::listen('user.create', function($user) {
  // Sign user up for transaction messages.
  $credentials = Config::get('messagebroker.credentials');
  $config = Config::get('messagebroker.config');<commit_msg>Add country code to vote payload.<commit_after><?php

// An event listener that handles user votes.
Event::listen('user.vote', function($candidate, $user) {
  // Sign user up for transaction messages.
  $credentials = Config::get('messagebroker.credentials');
  $config = Config::get('messagebroker.config');
  $config['routingKey'] = 'cgg.event.vote';

  $mb = new MessageBroker($credentials, $config);

  $payload = [
    // User information
    'first_name' => $user->first_name,
    'email' => $user->email,
    'mobile' => $user->phone,
    'birthdate_timestamp' => $user->birthdate_timestamp(), // Message Broker expects UNIX timestamp
    'country_code' => $user->country_code,

    // Candidate information
    'candidate_id' => $candidate->id,
    'candidate_name' => $candidate->name,

    // Request specific information
    'activity' => 'cgg2014_vote',
    'application_id' => 201,
    'activity_timestamp' => time(),
    'email_template' => 'mb-cgg2014-vote',
    'email_tags' => [
      0 => 'cgg2014_vote',
    ],
    'mailchimp_grouping_id' => '10621',
    'mailchimp_group_name' => 'CelebsGoneGood2014',
    'mc_opt_in_path_id' => '174269',
    'merge_vars' => [
      'FNAME' => $user->first_name
    ]
  ];

  $payload = serialize($payload);
  $mb->publishMessage($payload);

});

Event::listen('user.create', function($user) {
  // Sign user up for transaction messages.
  $credentials = Config::get('messagebroker.credentials');
  $config = Config::get('messagebroker.config');
{'fraction_non_alphanumeric': 0.17452667814113598, 'fraction_numerical': 0.02134251290877797, 'mean_word_length': 4.036395147313692, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4688363', 'n_tokens_mistral': 1001, 'n_tokens_neox': 948, 'n_words': 178}