Open ConnorVO opened 3 years ago
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'
});
}}
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
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
I managed to solve adding tags with <MailSubscribeForm status={ status } message={ message } onValidated={(formData) => {subscribe({...formData, "tags": "SOME TAG NUMBER"})}} />
@liordavid Where do you find the tag number?
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.
Tried adding a hidden input like Mailchimp suggests, but that doesn't seem to work.