Support » Plugin: Email Subscribers & Newsletters - Simple and Effective Email Marketing WordPress Plugin » Email Subscribers – Warning: Invalid argument

  • Resolved skipperjohn


    I am getting this message on the page:
    Warning: Invalid argument supplied for foreach() in /data/11/0/134/20/949835/user/980166/htdocs/wpsilverfly/wp-content/plugins/email-subscribers/public/partials/class-es-shortcode.php on line 149

    If I complete the form and select ‘Subscribe’ I get a message saying ‘Select the list’ but what list?

    Can you please tell me what I should do?

    Many thanks, John

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Check “Audience” -> “Manage Lists”. There should be at least one list.
    Then check your Form, you should have checked at least one list.
    Also check your campaign for the list selected.

    With Lists you can manage several subscribtions forms and where the subscribers are put on which list. Then you can use this to select for which list, which action (e.g. sending of blog post notifications) is taken.

    If you have only one form for one action, you only need one list.

    Hi, Many thanks for that, in the meantime I have found that I cannot have ReCaptcha unless I upgrade to Pro, therefore I have replaced Email Subscribers with MailChimp which not only solved my Error problem, but allows me to use ReCaptcha FOC.

    Many thanks

    I too am getting this error. This is sloppy. Please trap the error and display a more useful message.

    Plugin Contributor Malay Ladu


    @tylertork Please make sure you have selected at least one list in the form which you are using to get the subscribers.

    Please go to Email Subscribers > Form and edit the form which you are using.

    I understand how to correct the problem. I’m saying you need to emit a less cryptic message so people can know what to do without going search for help. This sort of message should never be displayed on the website. It casts doubt on the quality of the tool as a whole.

    Plugin Contributor Malay Ladu



    Got it.

    Sure. We will take care of it.

    In my case the error message cites line 152 of the same source file. I debugged the code. Just before the “foreach” statement, the value of $list_ids is ‘2’ — not an array, a string.

    The widget uses the default form that your installer creates — “First Form”, which has list “Main” selected. If I edit it and save changes, the debug log now displays $list_ids = array ( 0 => ‘2’, ), and there is no error message displayed. So I think the defect is actually in your post-activation code where you’re creating the default form.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Email Subscribers – Warning: Invalid argument’ is closed to new replies.