Forum

Thread tagged as: Runway, Forms, MailChimp

Mailchimp Interest Group

Hi

How would I get a Perch Form checkbox to submit an Interest Group ID to Mailchimp? It works fine when you use a hidden input as per the docs but I want a user to choose their own groups for sign up by using a checkbox. On submission I get a Notice: Undefined index: warning and Mailchimp rejects the submission citing:

    [body] => {"type":"https://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/","title":"Invalid Resource","status":400,"detail":"Invalid interest ID: '_empty_'.","instance":"2f4c3509-cea2-4ed7-b097-4a17b7ef6db7"}

I've seen a few similar posts on the forum - e.g. this one, but none of them have a solution other than writing an app.

Jon

Perch Runway: 3.1.2, PHP: 7.1.12, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $, with PDO
Server OS: Darwin, apache2handler
Installed apps: content (3.1.2), assets (3.1.2), categories (3.1.2), perch_forms (1.12), perch_mailchimp (3.1)
App runtimes: <?php $apps_list = [ 'perch_forms', 'perch_mailchimp', ];
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/ellimondo/Dropbox/Sites/BLAH BLAH/perch
PERCH_CORE: /Users/ellimondo/Dropbox/Sites/BLAH/perch/core
PERCH_RESFILEPATH: /Users/ellimondo/Dropbox/Sites/BLAH/perch/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
HTTP_HOST: dev.wibexpo.local
DOCUMENT_ROOT: /Users/ellimondo/Dropbox/Sites BLAH
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Jonathan Elliman

Jonathan Elliman 27 points

  • 2 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I think I would do this:

<perch:input type="checkbox" id="cheese" value="a375f7a461" mailer="interests">

What did you try?

Yes, that's exactly what I used (see below) and received the reply from Mailchimp as shown above. I think Perch submits an empty value even though the checkbox is unchecked and so the submission gets rejected.

<perch:input type="checkbox" name="visiting" class="f-checkbox" id="visiting" value="7c7cc6036f" mailer="interests">
Drew McLellan

Drew McLellan 2638 points
Perch Support

That sounds like it could be a bug then. I'll look into it.

Thanks Drew