cannot get mailinglist parameter to work
Posted: 26 June 2009 09:29 AM   [ Ignore ]
Newbie
Rank
Total Posts:  5
Joined  2009-02-11

I’ve used freeform for a simple mailing list sign up form and it works great, except that the mailing list subscription does not happen.

I’m using the following form tag:

{exp:freeform:form form_name="list" form_id="formList" required="name|email" return="site/thanks-list" mailinglist="default" mailinglist_opt_in="yes"

This results in the following code appearing in my form html:

<input type="hidden" name="mailinglist[]" value="1" /> 

I have tried setting mailinglist_opt_in to no and leaving it out completely.
I’ve also tried using a hidden form field with name mailinglist[] and value default instead.

I cannot for the life of me see what’s going wrong, but I’m hoping I’m just doing something stupid!?

The standard EE mailing list sign up form is working, and I only have the one mailing list with short name default.
I need to use Freeform instead of the standard mailing list form, because I want to collect more info.
I am using EE 1.6.7 (personal) and Freeform 2.7.2.

Any help on this would be greatly appreciated.
Thanks,
Janine.

Profile
 
 
Posted: 26 June 2009 09:39 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8290
Joined  2006-10-18
Janine - 26 June 2009 09:29 AM

I cannot for the life of me see what’s going wrong, but I’m hoping I’m just doing something stupid!?

It’s possible! grin haha

My first guess was maybe that the Mailing List “default” or “1” did not exist. But that seems not to be the case.

Second question… are you using a field called “email” to collect your email addresses? smile

 Signature 
Profile
 
 
Posted: 26 June 2009 10:09 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  5
Joined  2009-02-11

Thanks for the quick reply Kelsey.

Yes, my mailing list is called default (came with install) and I can see from the CP urls that it has list_id 1.

I am collecting my email addresses via a field called email. Here’s the code:

<p><label for="name">Name:</label><br />
<
input class="required" type="text" id="name" name="name" size="40" maxlength="50" value="{name}" /></p>
<
p><label for="from">Email:</label><br />
<
input class="required email" type="text" id="email" name="email" size="40" maxlength="50" value="{email}" /></p

It would be great to be able to get this working. I think I’m getting RSI from all the EE forum searching I’ve been doing today smile

Profile
 
 
Posted: 26 June 2009 01:02 PM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8290
Joined  2006-10-18

Janine,

Do you have any JS validation on your form? smile

 Signature 
Profile
 
 
Posted: 29 June 2009 05:19 AM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  5
Joined  2009-02-11

Hi Kelsey,

Yes, I have the jquery validate plugin on that form. I am using this on a contact form done with freeform without any issues, could it be causing a problem here?

I just removed the validation script there (and the classes from the fields) but it still doesn’t work. Any more ideas?

Thanks,
Janine.

Profile
 
 
Posted: 29 June 2009 07:48 AM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8290
Joined  2006-10-18

Hi Janine,

Actually, try using the short_name in a hidden field, just like this code here (do not use the parameter): smile

<input type="hidden" name="mailinglist[]" value="default" /> 
 Signature 
Profile
 
 
Posted: 29 June 2009 07:57 AM   [ Ignore ]   [ # 6 ]
Newbie
Rank
Total Posts:  5
Joined  2009-02-11

Hi Kelsey,

I had tried specifying a mailinglist[] field, but this did not work either. I just tried again now, but it still doesn’t work.

Here is my form code now - javascript removed and hidden mailinglist[] field as per your advice:

{exp:freeform:form form_name="list" form_id="formList" required="name|email" return="site/thanks-list"}
<p><label for="name">Name:</label><br />
<
input type="text" id="name" name="name" size="40" maxlength="50" value="{name}" /></p>
<
p><label for="from">Email:</label><br />
<
input type="text" id="email" name="email" size="40" maxlength="50" value="{email}" /></p>
<
input type="hidden" name="mailinglist[]" value="default" />  
<
p><input name="submit" type='submit' value='Submit' /></p>
{/exp:freeform:form} 

Thanks for your patience - I really wish I could figure this out…

Profile
 
 
Posted: 30 June 2009 09:33 PM   [ Ignore ]   [ # 7 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8290
Joined  2006-10-18

Janine,

Do you mind PM’ing me CP access to your site to have a look? smile

 Signature 
Profile
 
 
Posted: 01 July 2009 12:04 PM   [ Ignore ]   [ # 8 ]
Newbie
Rank
Total Posts:  5
Joined  2009-02-11

Thanks for offering to go to that trouble Kelsey, but I’m just a developer working on this site, and while as a developer I understand the need to “look under the hood”, my client is not comfortable with me sharing this information at this stage.
But thanks so much for all your assistance on this. smile
I guess, we will just have to sacrifice capturing any extra info on sign up and stick to the default expresssionengine mailing list module instead for now :(

Profile
 
 
Posted: 17 August 2009 02:24 PM   [ Ignore ]   [ # 9 ]
Newbie
Rank
Total Posts:  25
Joined  2009-08-17

I’m having the exact same issue.

As far as I can tell, I’ve got everything set up correctly.

Here’s my code:

{exp:freeform:form 
form_name
="mailing_list_newsletter" 
required="email" 
mailinglist="newsletter" 
notify="myemail@mydomain.com" 
template="default_template" 
onsubmit="alert('Thanks');" 
prevent_duplicate_on="email" 
required="email" }
        
<input type="text" id="mailing_list_email" name="email" value="Enter your email address" size="18" />
        
<
input type="submit" value="Join" class="submit_button"/>
        
<
input type="checkbox" name="mailinglist[]" value="newsletter">
        
{/exp:freeform:form} 

The form submits and redirects successfully, and adds the email to the Freeform DB, but not to EE’s mailing list.

Help?
smile

Profile
 
 
Posted: 17 August 2009 02:36 PM   [ Ignore ]   [ # 10 ]
Newbie
Rank
Total Posts:  25
Joined  2009-08-17

Got it working.

Looks like onsubmit=“alert(‘Thanks’);” was messing up the form submission.

Can anyone advise how to properly apply onsubmit=”” without breaking the form submit?

Profile
 
 
Posted: 05 October 2009 10:58 PM   [ Ignore ]   [ # 11 ]
Newbie
Rank
Total Posts:  3
Joined  2009-09-08

I got my code to work finally. It’s a mailing list sign up. The user gets an email (variable is “send_user_email”) from a specific template (variable is “user_email_template”) set up in Freeform. I also get an email from another template set up in Freeform (variable is “template”). My form automagically adds the user to my EE mailing list (called “newsletter”) by using the variable/value “mailinglist_opt_in=“no”, and also using the variable “mailinglist=”.

{exp:freeform:form form_name="sign-up" return="main/confirmation" notify="me@gmail.com" send_user_email="yes"  user_email_template="free_resource"  template="autoresponder" required="email" mailinglist_opt_in="no"  mailinglist="newsletter" }

<input type="text" id="name" name="email" value="Name" size="18" /> 
<
input type="text" id="mailing_list_email" name="email" value="Email address" size="18" /><br/>
<
input type="submit" value="Join" class="submit_button"/>
        
 
{/exp:freeform:form} 
Profile
 
 
   
 
 
‹‹ mailing list not working      Status ››