Closed wcalebgray closed 7 years ago
I think this is where the problem is coming from:
def merge_vars(model)
attributes = Config.merge_vars.except('EMAIL')
array = attributes.map do |tag, method|
value = model.send(method) if model.methods.include?(method)
[tag, value.to_s]
end
Hash[array]
end
I'll attempt to fix this and submit a PR. It doesn't look like this method is set up to take arrays as values in the merge_vars.
@wcalebgray hmm, I was previously unaware of groupings. The merge vars method like you showed would have to pivot on a the method being an array. Than the array of methods would have to be available on the user object?
@wcalebgray this, I believe(the MailChimp API docs are a little bonkers) is the method we use to add merge vars. I am only seeing key value pairs as params and no arrays. Am I missing something? Perhaps the groupings call was in the v1 version of their API?
@wcalebgray there was just a move to mailchimp 3.0 API can you see if you are still having the issue and maybe create a new fresh issue? Thank you.
Hello,
I'm trying to insert a merge_var for 'groupings' as I've done with the Mailchimp API in the past to automatically subscribe the user to a specific group within my list. I've tried to set this in the config as follows:
The user is subscribed with his/her first and last names as expected, but the grouping does not show up. I have another form in this same project that allows a user to sign-up without creating a user profile. It uses an identical format for the merge_vars, just with a different subgroup name and works as expected.
Also, I do believe 'groupings' needs to be lower-case for this to work, from the many StackOverflow posts I've checked out.
Any ideas?
Thanks!