Plugin

Archived
Forum
(read-only)

Jeremy Worboys does not actively monitor this forum
(but you can still get help from other EE users).

Simple MailChimp

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Jeremy Worboys

     

You must be logged in to post.

Form fields do not display

Support (Resolved)

mbliss
mbliss

Hello! 

I just purchased a copy of simple mailchimp.  I am using EE 2.5.5 and PHP version 5.2.17.

I had installed the plugin as directed and used the sample to create my first form. 

{exp:simple_mailchimp
api_key
="XXXX"
list_id="XXXX"
return="{'affiliates/tabata_download'}"
error_delimeters='<p class="error">|</p>'}
{if success}
<class="success">SuccessCheck your email to activate your subscription.</p>
{if:else}
<p>
{label:EMAIL}
{merge
:EMAIL}
{error
:EMAIL}
</p>
<
p>
{label:VIDSRC}
{merge
:VIDSRC hidden="true" value="affiliate_tabata_2013"}
</p>
{submit}
{
/if}
{
/exp:simple_mailchimp} 

Unfortunately, when the page renders I get two PHP errors:

1. Message: Invalid argument supplied for foreach()  | Filename: simple_mailchimp/pi.simple_mailchimp.php

2.  Message: Cannot modify header information - headers already sent by (output started at /path/codeigniter/system/core/Exceptions.php:170)  Filename: core/Common.php

And the form does not render.  I only see the variable names in brackets. 

{label:EMAIL} {merge:EMAIL} {error:EMAIL}

{label:VIDSRC} {merge:VIDSRC value=“affiliate_tabata_2013”}

Here is the page i’m working with:  www.thefitfem.com/index.php?/affiliates/

Is there something that I’ve forgotten to set or have set incorrectly.  Thank you so much for your help :) 

- Michelle

Jeremy Worboys
# 1
Developer
Jeremy Worboys

Hey Michelle,

Happy to help :)

Does the error message include a line number at all? PHP error messages are by default only shown to members who are logged in and in the Super Admin group, so I can not see the error myself.

mbliss
# 2
mbliss

Hello!  Thank you for getting back to me so fast!  The error came in on line number 143.

Jeremy Worboys
# 3
Developer
Jeremy Worboys

Thanks.

The error is happening when the code tries to loop through the merge fields set up in MailChimp. Have you set up the fields in MailChimp?

mbliss
# 4
mbliss

Sure do :)  I’ve attached a screenshot.  Only issue i’m having with the new version of mail chimp is finding the list id.  So i pulled it from the URL string at the top of the page.  It’s also been a while since i’ve used the API key.  Should i try and generate a new one?

Jeremy Worboys
# 5
Developer
Jeremy Worboys

I think the issue is from when you pulled the list ID from the URL. To find the ID in the new interface, click the dropdown arrow next to “stats” for the list and select the “settings” option. The list ID will be at the bottom

mbliss
# 6
mbliss

Thank you so much!  Been having trouble finding things in the new interface.  One more quick question for you.  Can i make a field hidden using the attributes?

Jeremy Worboys
# 7
Developer
Jeremy Worboys

No worries.

The type attribute is locked to using whatever MailChimp dictates. However you can still put a regular <input type=“hidden”> field without using Simple MailChimp variable. Just ensure the name=”“ attribute on your input field matches what the variable would create.

mbliss
# 8
mbliss

Thank you!  I’ve got the fields displaying.  One last question.  Does the return path need to be the same as what is setup in mailchimp or can it be anything i assign it?  Once again, thank you!  you’ve been so helpful and so fast!

Jeremy Worboys
# 9
Developer
Jeremy Worboys

The return path can be anything you like.