You appear to be still doing the same mangling on merge_vars as was used when the module was using a GET rather than POST method, so the JSON (without URL encoding) looks like:-
{"merge_vars[FNAME]":"Fred",
"output":"json",
"merge_vars[GROUPINGS][0]":{"name":"Roles",
"groups":"Stage Manager,Assistant Stage Manager,Fly,Sound,Follow-spot,Get In/Get Out,Admin,Crew Web"},
"email_address":"xxx@example.com",
"merge_vars[LNAME]":"Bloggs"}
This is not accepted by Mailchimp which throws an error about missing merge_vars
Removing the merge_vars mangling so that the JSON looks like:-
{"output":"json",
"merge_vars":["FNAME","Fred",
"LNAME","Bloggs",
"GROUPINGS",[{"groups":"Stage Manager,Assistant Stage Manager,Fly,Sound,Follow-spot,Get In/Get Out,Admin,Crew Web",
"name":"Roles"}]],
"email_address":"xxx@example.com"}"
does not throw an error - although need to test further to make sure its really doing what I expect!
What I have currently tried is removing lines 143 to 154 of the current version (ie the first block of code in _build_query_args
I suspect further simplification to remove the excess arrays (ie the additional [] in GROUPINGS might well work too.
You appear to be still doing the same mangling on merge_vars as was used when the module was using a GET rather than POST method, so the JSON (without URL encoding) looks like:-
This is not accepted by Mailchimp which throws an error about missing merge_vars
Removing the merge_vars mangling so that the JSON looks like:-
does not throw an error - although need to test further to make sure its really doing what I expect!
What I have currently tried is removing lines 143 to 154 of the current version (ie the first block of code in
_build_query_argsI suspect further simplification to remove the excess arrays (ie the additional
[]inGROUPINGSmight well work too.