0

I've really been having a lot of trouble here... I have an HTML landing page and within the page there are a few forms. One of these forms collects user emails. I want to send these emails to my Mailchimp list but I am having the hardest time.

I created a form through mailchimp and embedded it on my page. I made a few minor style modifications but left in place the info mailchimp said I needed.

My problem is that every time I submit an email address through the form, my list on mailchimp does not get updated. Meaning, I do not think anything is "getting through" here on my HTML landing page end. Did I do something wrong?

Here's my form code:

<div id="mc_embed_signup">
    <form action="http://inspireconversation.us7.list-manage.com/subscribe/post?u=ee86d645c5e94d2c51a62c797&amp;id=07c5091ff0" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
        <div id="mc-email-field">
            <input type="email" value="Enter your email address" name="EMAIL" class="required email" id="mce-EMAIL">
        </div>
        <div id="mce-responses" class="clear">
            <div class="response" id="mce-error-response" style="display:none"></div>
            <div class="response" id="mce-success-response" style="display:none"></div>
        </div>    
        <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
        <div style="position: absolute; left: -5000px;">
            <input type="text" name="b_ee86d645c5e94d2c51a62c797_07c5091ff0" value="">
        </div>
        <div class="clear">
            <input type="submit" value="Send" name="subscribe" id="mc-embedded-subscribe" class="send">
        </div>
    </form>
</div>

I added this to the stylesheet:

#mc-email-field { text-align: center; width: 80%; margin: 0 auto; }
#mc_embed_signup { font: 14px Helvetica, Arial, sans-serif; width: 509px;}

here's the URL for the landing page: http://contest.realfamilytrips.com (this contest is not yet active, thank you :)

Another problem is I can't seem to get the field input area to reach 509px but this is a minor issue at the moment. My main concern is connecting this form to my mailchimp list.

Thanks everyone for your help. Much appreciated.

kleinfreund
  • 6,546
  • 4
  • 30
  • 60
user252415
  • 19
  • 4
  • The code here looks ok at a glance. But more details are needed to help solve this. After you put in your email address and click Send, do you get redirected to your thank you page? Do you get a confirmation email? Also, I've noticed that new subscribers won't show immediately in MailChimp when testing (logout and login makes them show up). – ryanman Dec 31 '13 at 15:26
  • Ryanman, I am using the "super slim" form. Not sure if there should be a "thank you" page. If there is, no we are not getting one. I would want to disable it anyway as it would interfere with the three-step process we have going on (answer question, submit email, go to website to submit itinerary). I know we are not getting confirmation emails as no one is being added to the list. The submitted email goes nowhere (or is not submitted, essentially). Thanks for helping me get to the bottom of this. Any further thoughts? – user252415 Dec 31 '13 at 16:15

1 Answers1

0

I've examined the linked landing page and it looks like you are preventing the mailchimp form from submitting with this code in functions.js:

$(document).on('submit', 'form', function (e) {
    // Check email address
    // if email address ok
        $('.step-2').hide();
        $('.step-3').fadeIn(800);
        e.preventDefault();
    // else 
        // alert
        // e.preventDefault();
    // end if
});

The e.preventDefault() call means you are handling the event. Yet, you are not submitting the form. So, the form isn't submitted to mailchimp.

I can see what you are trying to do here, which is subscribe someone without the normal mailchimp flow (click subscribe, redirect to thank you page, etc). This answer shows how to do it. After your e.preventDefault() call, you would invoke an ajax call like that answer does in its 'register' function. I don't know if this is officially supported by mailchimp, but I just tested it and it does work.

I think the supported route is typically to use the mailchimp API from your server-side code. The API must be called server-side because it uses your mailchimp api key, which you'd want to keep private.

Community
  • 1
  • 1
ryanman
  • 3,794
  • 3
  • 25
  • 15
  • Thanks a bunch, ryanman. I think I get it. Using the API looks like a bit of a stretch for what I am capable of doing. Do you suggest maybe saving the email form data as a .txt file in my directory and then importing it to mailchimp periodically? Can that be done with my current setup and flow? If so, can you give me a few tips to get that done? (I know it involves a .php script). I really appreciate the help you've given me so far. Thanks. – user252415 Dec 31 '13 at 18:18
  • I've updated my answer to reference [this answer](http://stackoverflow.com/a/15120409/215821) which shows how to subscribe someone without using server side code. – ryanman Jan 01 '14 at 20:35