Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we add people to groups or tag them on submission? #54

Open
ConnorVO opened this issue Feb 1, 2021 · 6 comments
Open

Can we add people to groups or tag them on submission? #54

ConnorVO opened this issue Feb 1, 2021 · 6 comments

Comments

@ConnorVO
Copy link

ConnorVO commented Feb 1, 2021

Tried adding a hidden input like Mailchimp suggests, but that doesn't seem to work.

@MichaelMarner
Copy link

You can do this already using a custom form, just add the group information to the data you are sending. For example:

        onSubmit={e => {
          e.preventDefault();
          this.props.onSubmit({
            EMAIL: this.state.email,
           'group[8291][1]': '1'
          });
        }}

@thisisthais
Copy link

is there a way to do this with tags? I tried

onValidated={(formData) =>
                    subscribe({
                      ...formData,
                      tags: ['MY TAG NAME'],
                    })
                  }

the request was posted succesfully but the tag was not added

@smac89
Copy link

smac89 commented Sep 2, 2021

If anyone is wondering, here is the doc that describes how to automatically add customers to groups:
https://mailchimp.com/help/automatically-add-subscribers-to-a-group-at-signup/

is there a way to do this with tags? I tried

onValidated={(formData) =>
                    subscribe({
                      ...formData,
                      tags: ['MY TAG NAME'],
                    })
                  }

the request was posted succesfully but the tag was not added

I don't think this can be done in the same way as the groups thing, but you can checkout their tags api

@liordavid
Copy link

I managed to solve adding tags with
<MailSubscribeForm
status={ status }
message={ message }
onValidated={(formData) => {subscribe({...formData, "tags": "SOME TAG NUMBER"})}}
/>

@tim-basic
Copy link

@liordavid Where do you find the tag number?

@tim-basic
Copy link

tim-basic commented Feb 11, 2023

I managed to get tags working like this within a custom form:

  const handleSubmit = (e) => {
    email &&
      firstName &&
      lastName &&
      rsvpFor &&
      numAttending &&
      email.indexOf('@') > -1 &&
      onValidated({
        'group[54061][1]': '1',
        EMAIL: email,
        MERGE1: firstName,
        MERGE2: lastName,
        MERGE9: rsvpFor,
        MERGE7: numAttending,
        tags: '10511025,10511021',
      });
  };

I got the tag numbers by making an embedded form with the tags and then looking at the tag input in the generated code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants