gatsby-plugin-mailchimp icon indicating copy to clipboard operation
gatsby-plugin-mailchimp copied to clipboard

Can this be used with Mailchimp's Contact Form / Inbox?

Open modulareverything opened this issue 4 years ago • 4 comments

They give a similar endpoint for their contact forms so I'm wondering if this is possible using this plugin?

modulareverything avatar May 12 '21 11:05 modulareverything

Thought I'd update this as I'm trying things out.

I tried adding the contact form endpoint in place of the default mailing list endpoint, like this (where my_user_id and contact_form_id are the proper ids from the endpoint):

    addToMailchimp(
      data.contactEmail,
      {
        NAME: data.contactName,
        SUBJECT: data.contactSubject,
        MESSAGE: data.contactMessage,
      },
      'https://us1.list-manage.com/contact-form?u=my_user_id&form_id=contact_form_id'
    );

This doesn't work and gives me some errors I'm unsure about:

Uncaught (in promise) Error: Timeout
    at eval (index.js:63)

and also a "CORB" error (never heard of this):

index.js:94 Cross-Origin Read Blocking (CORB) blocked cross-origin response https://us1.list-manage.com/contact-form?u=my_user_id&form_id=contact_form_id&EMAIL=hey%40chrish.design&NAME=Chrish&SUBJECT=Testing%20Subject&MESSAGE=My%20message%20would%20go%20here&c=__jp2 with MIME type text/html. See https://www.chromestatus.com/feature/5629709824032768 for more details.

modulareverything avatar May 12 '21 11:05 modulareverything

I tried adding this into the index.js file of this plugin to see if contact-form needed to be contact-form-json the same as post does...

    if(endpoint.includes('contact-form')) {
        endpoint = endpoint.replace(/\/contact-form/g, '/contact-form-json');
    } else {
        endpoint = endpoint.replace(/\/post/g, '/post-json');
    }

but nah, no joy here either!

modulareverything avatar May 12 '21 13:05 modulareverything

did you find any solution?

CaptainHaider avatar Aug 03 '21 12:08 CaptainHaider

I was also hoping to use this plugin with a contact form but I'm getting the CORB error. Does anyone have any tips / alternatives to suggest?

Thanks 🙏🏼

LucyMac avatar Oct 03 '22 14:10 LucyMac