-
Notifications
You must be signed in to change notification settings - Fork 80
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
Tags not being set with list.UpdateUser #34
Comments
I'm getting the same issue here. |
Looks like the mailchimp api doesn't support tags for updates :( https://mailchimp.com/developer/reference/lists/list-members/#create-post_lists_list_id_members |
@royalgiant I see tags at the bottom of the Request Body Parameters section. |
Check under the "EDIT" instead of the "CREATE" section |
This is very odd, tags is clearly on the Member request object with the correct parameter name. Line 26 in 1023e7b
|
@royalgiant thanks, I was looking at CREATE and not EDIT. I found this which could possibly be used: https://mailchimp.com/developer/reference/lists/list-members/list-member-tags/ |
@montanaflynn @davidtai You're going to kiss me for this.
That's what worked for me. Let me know if it helps. |
client := gochimp3.New(apiKey)
type MailChimpTags struct {
Name string `json:"name"`
Status string `json:"status"` // 2 options: 'active' and 'inactive' to add and remove tags respectively
}
var memberTags []MailChimpTags
for _, tag := range tags {
memberTags = append(memberTags, MailChimpTags{Name: tag, Status: "active"})
}
loweredEmail := strings.ToLower(email)
md5Sum := fmt.Sprintf("%x", md5.Sum([]byte(loweredEmail)))
endpoint := fmt.Sprintf("/lists/%s/members/%s/tags", listID, md5Sum)
err := client.Request("POST", endpoint, nil, map[string]interface{}{"tags": memberTags}, nil)
if err != nil {
return err
} |
I'm trying to update a users tags, I don't get an error but the tags are not being updated:
Related: #31 cc @zeekay
The text was updated successfully, but these errors were encountered: