statamic-rad-pack / mailchimp

Mailchimp integration for Statamic
https://statamic.com/addons/rad-pack/mailchimp
MIT License
18 stars 12 forks source link

400: The resource submitted could not be validated. #26

Closed websmyth closed 4 years ago

websmyth commented 4 years ago

I’ve connected a formset to MailChimp but logbook is showing the following error on submission:

400: The resource submitted could not be validated. For field-specific details, see the 'errors' array.

The issue only appears when I add the formset to MailChimp (under Form on the settings page), and emails aren’t passed to the corresponding mailing list.

I’ve tried removing the validation from the formset, but that didn’t work.

Formset

store: false
honeypot: email_address
fields:
  user_email:
    display: Email
    validate: email|required
columns:
  - user_email
edalzell commented 4 years ago

I bet it's because it assumes the email field is email

websmyth commented 4 years ago

Thanks, Erin. I’ve changed the formset (and corresponding inputs etc) to:

store: false
honeypot: email_address
fields:
  email:
    display: Email
    validate: email|required
columns:
  - email

The error has changed to 400: Your merge fields were invalid.

I haven’t set merge fields as there’s only one and it looks from the docs that email is assumed and auto-merged. I’ve also tried adding merge fields and it’s the same result.

Any ideas? Seems odd.

edalzell commented 4 years ago

Let's see your mailchimp.yaml

websmyth commented 4 years ago
mailchimp_key: *************************
add_new_users: true
user_disable_opt_in: false
user_check_permission: false
user_mailchimp_list_id: ************
forms:
  -
    mailchimp_list_id: *************
    disable_opt_in: false
    form: mailing_list
    check_permission: false
edalzell commented 4 years ago

Let's see the list (audience) settings:

image
edalzell commented 4 years ago

And can you please check your Statamic log to see the there are more details there?

websmyth commented 4 years ago

image

The Statamic logs don’t reveal anything more, unfortunately: [2019-10-29 16:07:12] dev.ERROR: 400: Your merge fields were invalid.

edalzell commented 4 years ago

You’ve got required fields you don’t have in your fieldset, FNAME and LNAME.

EIther add them or don’t make them required

websmyth commented 4 years ago

Ah, of course. Thanks for your help – I’ll ask my client to change that.

edalzell commented 4 years ago

Please re-open if issue persists after making those changes.