revolunet / react-mailchimp-subscribe

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

Functionality with React Bootstrap? #37

Closed awitherow closed 4 years ago

awitherow commented 4 years ago

Has anyone managed to get a custom form working with react-bootstrap Forms and react-mailchimp-subscribe?

markmssd commented 4 years ago
<MailchimpSubscribe
              url={url}
              render={({ subscribe, status, message }) => (
                <div>
                  <Form onSubmit={formData => {
                    formData.preventDefault()
                   // uppercase EMAIL is important
                    subscribe({ EMAIL: email })
                  }}>
                    <InputGroup size={'lg'}>
                      <Form.Control
                        placeholder={'email@gmail.com'}
                        aria-label={'Email'}
                        name={'email'} value={email}
                        onChange={handleEmailChange}
                      />

                      <InputGroup.Append>
                        <Button type={'submit'}
                                variant={'dark'}>
                          SUBSCRIBE
                        </Button>
                      </InputGroup.Append>
                    </InputGroup>
                  </Form>

                  {status === 'error' && <div style={{ color: 'red' }} dangerouslySetInnerHTML={{ __html: message }} />}
                </div>
              )}
            />
awitherow commented 4 years ago

Thanks for the information! This is good 👍

awitherow commented 4 years ago

Thanks for the information! This is good 👍