The mailchimp module has the ability to allow the administrator to set the default values for additional fields when subscribing a user to a mailing list. It does so by presenting the admin with list of all the available fields for each list and allowing them to choose from a list of tokens that will be used to figure out what information to submit for those merge fields.

The uc_mailchimp module loads the mailchimp API class from the mailchimp module and just calls the listSubscribe method directly. This means that the default merge variable settings from mailchimp module are ignored.

This can become an issue when you've got a list with a required merge field. MailChimp will reject the subscription request if you don't provide a value for that field and uc_mailchimp has no way of allowing you to provide a value.

The attached patch ensures that mailchimp module's settings for merge field values are respected when uc_mailchimp attempts to subscribe a user.

Comments

eric.chenchao’s picture

Thanks for the uc_mailchimp which is really good to integrate mailchimp with ubercart.

@eojthebrave, That is really a good idea, and this patch works well on my site. Hope it can be imported into next release:)

Thanks, Eric