I'm running a D7 multilingual site and I want all registered users to be part of a required list, in order to send them a newsletter.
However I want to send the newsletter in the language set as their preference in their user profile.

I was thinking to use the standard language settings field of the user profile and merge it as a mailchmp field , to use a single list on Mailchimp.
But I don't see this field on the "merge fields" dropdown in the drupal mailchimp module configuration.

Any tips how to manage that ?
Thanks.

Comments

Same here. Mailchimp is perfect for all my needs, I just need my website to be able to use the various lists created depending on user language. Nowhere to be found in the list setup.

just came across this issue myself...any update on this matter?

edit: a workaround could be to add the language fields yourself (in the user profile) and disable the languge settings in a user profile through theming

A few weeks ago I needed to say in any way to mailchimp send emails depending the user language by default. It was a D6 installation.

First I created different groups per language and then :

<?php
--- a/sites/all/modules/vanilla/mailchimp/mailchimp.module
+++ b/sites/all/modules/vanilla/mailchimp/mailchimp.module
@@ -924,6 +924,25 @@ function _mailchimp_load_user_list_mergevars($uid, $list_id, $mergevars) {
  
$uservars = array(
      
'EMAIL' => $account['mail']
   );
// Depending language we add the user to a group created previously on Mailchimp.
// By default 3 group options English, French and Spanish.
// By default the name of the group is Languages so you need to create this group and options.
// When you send a campaign then you have to select by segment and send different campaigns
// for each language.
+  switch ($account['language']) {
+    case
'en':
+     
$lang = 'English';
+      break;
+    case
'es':
+     
$lang = 'Spanish';
+      break;
+    case
'fr':
+     
$lang = 'French';
+      break;
+    default:
+     
$lang = 'English';
+  }
$uservars['GROUPINGS'][] = array('name' => 'Languages', 'groups' => $lang);
   foreach (
$mergevars as $mergevar) {
     if (!empty(
$list->mergevars[$mergevar['tag']]) && $key = $list->mergevars[$mergevar['tag']]) {
      
$uservars[$mergevar['tag']] = $account[$key];
?>

So when running cron job we add emails to mailchimpo depending default language selected on user profile.

Hope this info helps you one day.

Issue summary:View changes

Maybe this can help.
From the mailchimp API doc : http://apidocs.mailchimp.com/api/2.0/lists/subscribe.php
In the "merge_vars" structure, you can use "MC_LANGUAGE" to add the preferred language of the user who subscribe to the list. A little modification can be made in the mailchimp_lists_process_subscribe_form_choices function (line 595 of mailchimp_list.module, 7.x (7.x-2.12 in my case)) :

<?php
   
if (!$is_anonymous) {
     
$mail = $account->mail;
     
$selected = !empty($form_list['subscribe']);
     
$mergevars = mailchimp_lists_load_user_mergevars($account, $list, $interest_groups);
    }
    else {
     
$mail = $form_list['mergevars']['EMAIL'];
     
$mergevars = $form_list['mergevars'];
     
// Include interest groups if present:
     
if (!empty($interest_groups)) {
       
$mergevars['GROUPINGS'] = _mailchimp_lists_reformat_groupings($interest_groups);
      }
    }
+   global
$language, $user;
+  
$lang = $language->language;
+   if( !
$is_anonymous && isset( $account->language ) && !empty( $account->language ) )
+      
$lang = $account->language;
+  
$mergevars['MC_LANGUAGE'] = $lang;
   
$is_subscribed = mailchimp_is_subscribed($list->mc_list_id, $mail);
?>

In my case, now user subscribed to list has the language parametred in it account or if anonymous, the global language value when he subscribe.

Hope this help.