For the subscription form block it would be nice to have an option in the block settings to hide or remove the non-required fields from that block.

So if I have a mailing list with email, first name and last name fields but only the email field is required I can have a small block that just asks users to enter an email address.
If the user is authenticated, this information can still be auto populated in the background so those users get a more personalised newsletter but anonymous users can just give their email address.

Comments

kostajh’s picture

I was looking for this functionality as well.

Would it make sense to store the field settings (required/optional/visible/hidden) per list as a serialized array in the Mailchimp DB table? Would we want users to be able to configure field requirements/visibility for blocks separately from the form on mailchimp/subscribe?

rajmataj’s picture

A similar request ticket, http://drupal.org/node/686424, states that name fields are drawn from your setup in MailChimp itself. To do so after logging into MailChimp, go to this page and find instructions http://kb.mailchimp.com/article/advanced-customization-of-mailchimps-sign-up-forms/. If you remove the Last Name field, for example, it will not show in the MailChimp block for your site if users are setup to Opt-in.

Hope that helps.

agileware’s picture

@RajP:
Yeah, I have done that for the time being but if this feature was implemented it would mean I could collect names for logged in users from their account but anonymous users don't see any name fields.
So I get the best of both worlds.

ryank76’s picture

That would be a great feature and increase signups, as people would only need to enter email address.

skolesnyk’s picture

You achieve this by removing extra fields from a list's settings in Mailchimp.

andrewbenkard’s picture

I'm using 7.x but posting here since the solution may be similar. Sorry!

I too am trying to hide certain MailChimp fields (e.g. phone number) from being displayed to site visitors in the "native" signup block provided by the module.

I know that I can roll my own signup code at MC (per @rajmataj) and put that in a block, but it's less elegant than using the module's prebuilt block...

One can also completely delete fields at MC (per @skolesnyk) but I want to preserve the phone numbers in MailChimp.

So, is there any way to show only a few MC list fields in the module's signup block?

skolesnyk’s picture

Maybe try display:none css property on the fields you'd like to hide.

andrewbenkard’s picture

@skolesnyk - yes, that's the answer! Thank you.

marcus178’s picture

Why don't you use form_alter to remove the fields you don't want. It can be done like so.

function my_module_form_alter(&$form, &$form_state, $form_id) {
	//dpm($form);
	//dpm($form_id);
	switch($form_id) {
	case 'mailchimp_lists_user_subscribe_form_sign_up':
		unset($form['mailchimp_lists']['mailchimp_sign_up']['title']['#markup']);
		unset($form['mailchimp_lists']['mailchimp_sign_up']['mergevars']['NAME']);
		unset($form['mailchimp_lists']['mailchimp_sign_up']['mergevars']['GENDER']);
		unset($form['mailchimp_lists']['mailchimp_sign_up']['mergevars']['STUDENT']);
		unset($form['mailchimp_lists']['mailchimp_sign_up']['mergevars']['USERNAME']);
		unset($form['mailchimp_lists']['mailchimp_sign_up']['mergevars']['MOBILE']);
	break;
	}
}
nrackleff’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

“And now our watch [for support of the 6.x version of the MailChimp module] has ended…” With the end of Drupal 6 support, I’m sad to say we too must turn the page.

Fret not! The 7.x-4.x and 8.x versions come highly recommended. Both are using Mailchimp’s new API 3.0 and are being actively maintained. “What is dead may never die, but rises again, harder and stronger!”