Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add MailChimp subscriber to group with signup form, not API

I know you can do this with the API, but not sure about the regular signup form.

Does anyone know if it is possible to add some code to the advanced signup form in MailChimp that would automatically add them to a specific group within my list?

I am only collecting the email address and I don't want the subscriber to have to select the group manually. If they are using that form, I want them added to that group.

I have asked MailChimp for help, but they tell me that their customer support doesn't code and that I should hire an expert.

Perhaps a segment of the relevant code may help:

<form action="http://lalala.us2.list-manage1.com/subscribe/post" method="post">
<input type="hidden" name="u" value="345fc4974810ef65c8276c8">
<input type="hidden" name="id" value="25c4d1b28">
<table cellpadding="5" cellspacing="0" border="0" align="center">

<tr>
<td align="right" class="formLabel"><strong>Email Address</strong> <span class="asterisk">*</span>:</td>
<td align="left">
    <input type="email" autocapitalize="off" autocorrect="off" name="MERGE0" id="MERGE0" size="25" value="*|MERGE0|*">
<br><span class="error">*|HTML:EMAILERROR|*</span></td>
</tr>

Is there a hidden input type that I can add with a list grouping name that will auto add them to a group?

like image 259
user1015367 Avatar asked Feb 05 '13 21:02

user1015367


2 Answers

All I did was delete the other checkboxes (as well as the unordered list and list item tags around them) and change the checkbox representing the default group I wanted into a hidden field. Literally just type="hidden" instead of type="checkbox" and that did the trick.

like image 33
Marc Avatar answered Oct 19 '22 21:10

Marc


This is an old question, but I came across it looking for the answer myself and couldn't find a good answer anywhere (including the other answer here which is poor at best). When I couldn't find anything on this I was able to figure it out with a little experimentation.

It requires a couple steps. First, add your Group and the options you want the Group to contain (it can only be 1 if you want). Initially make sure the Group is not set to hidden. Go to your main default sign-up form in MailChimp under Sign Up Forms > General Forms. Verify the Group option(s) are visible and then use the Sign up form URL to visit your hosted sign-up form. Now, open the raw HTML in your browser using right-click > View Source. You need to find the INPUT element for the group / option you want. It will probably look something like this:

<input type="checkbox" data-dojo-type="dijit/form/CheckBox" id="group_8" name="group[13257][8]" value="1"  class="av-checkbox">

The name parameter is the critical thing here. Copy and paste that entire input element inside your custom form. Now, use inline CSS to hide it and HTML to hard-code it to checked. You can also remove extra stuff too. The final version in your custom form should look something like this:

<input type="checkbox" id="group_8" name="group[13257][8]" value="1" checked="checked" style="display:none">

This will ensure that it is not visible to the user but it will automatically add them to the group defined by the name parameter that you grabbed from the form which showed it.

The final step is to go back and make sure you set that Group to Hidden to make sure it doesn't inadvertently show up on other forms.

Pretty simple!

like image 65
Andrew Avatar answered Oct 19 '22 21:10

Andrew