revolunet / react-mailchimp-subscribe

React subscribe form for Mailchimp.
https://revolunet.github.io/react-mailchimp-subscribe/
245 stars 48 forks source link

add config to render mailchimp's automated response #5

Closed noslouch closed 6 years ago

noslouch commented 6 years ago

set messages.success or messages.error to null on the passed-in props in order to render whatever markup mailchimp returns from signup attempts.

So you can do something like this

const FORM_PROPS = {
  action: "https://prizoners.us9.list-manage.com/subscribe/post?u=d66d8c5d1ef09114cf8c27ccb&id=3c7edc9b14",
  messages: {
    success: null,
    error: null 
  }
}

...
<SubscribeForm {...FORM_PROPS} />
...

And the form will display the Mailchimp response from signup attempts. This is handy for error messages like signing up for a newsletter a user might already be signed up for.

revolunet commented 6 years ago

that's cool thank you !

revolunet commented 6 years ago

published as 1.0.3