You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.
Hi folks, hopefully someone can guide me as to what I might be doing wrong here. I am using the wrapper in a VB.NET project and all has gone well except I can't seem to update group interests, the error "Array is not a valid interest group in grouping .... on the list: ....". This occurs when I call either MailChimpManager.subscribe or MailChimpManager.UpdateMember.
I did try performing a call to MaiChimpManager.GetMemberInfo and then passing the data that was returned by this method straight back to subscribe or UpdateMember but the same error occurs which makes me ponder if there is an underlying issue with the wrapper (it's far more likely my code mind you!).
The code I am using is:
Public Sub SaveContact(APIKey As String)
Dim objManager As New MailChimpManager(APIKey)
Dim objParameter As New Helper.EmailParameter
Dim objVars As MergeVar = CreateMergeVar()
'ARE WE ADDING OR UPDATING?
If ID = "" Then
'WE ARE ADDING
objParameter.Email = Email
strID = objManager.Subscribe(objList.ID, objParameter, objVars,, False).EUId
Else
'WE ARE UPDATING
objParameter.Email = Email
objParameter.EUId = ID
strID = objManager.UpdateMember(objList.ID, objParameter, objVars).EUId
End If
End Sub
Private Function CreateMergeVar() As MergeVar
Dim objVar As New MergeVar
Dim objGroup As MCList.MCGroup
Dim objOption As MCList.MCGroup.GroupOption
Dim bolDoAdd As Boolean
Dim objDestGroup As Grouping = Nothing
Dim objInterest As Grouping.GroupInterest
objVar.Add("FNAME", strFirstName)
objVar.Add("LNAME", strLastName)
For Each objGroup In List.Groups
'CREATE A NEW GROUP IF NECESSARY
If objVar.Groupings Is Nothing Then objVar.Groupings = New List(Of Grouping)
'GO THROUGH EACH OPTION IN THE GROUP
bolDoAdd = False
For Each objOption In objGroup.Options
'CREATE A NEW INTEREST
objInterest = New Grouping.GroupInterest
objInterest.Interested = objOption.IsSubscribed
objInterest.Name = objOption.Label
'ADD THE GROUP IF IT ISN'T ALREADY IN THERE
If bolDoAdd = False Then
bolDoAdd = True
objDestGroup = New Grouping
objDestGroup.Id = objGroup.ID
objDestGroup.GroupNames = New List(Of String)
objDestGroup.GroupNames.Add(objGroup.Name)
objDestGroup.GroupInterests = New List(Of Grouping.GroupInterest)
objDestGroup.GroupInterests.Add(objInterest)
objVar.Groupings.Add(objDestGroup)
Else
'WE HAVE ALREADY ADDED THE GROUP SO JUST UPDATE IT
objDestGroup.GroupInterests.Add(objInterest)
End If
Next
Next
Return objVar
End Function
Thanks in advance! :-)
The text was updated successfully, but these errors were encountered:
Hi folks, hopefully someone can guide me as to what I might be doing wrong here. I am using the wrapper in a VB.NET project and all has gone well except I can't seem to update group interests, the error "Array is not a valid interest group in grouping .... on the list: ....". This occurs when I call either MailChimpManager.subscribe or MailChimpManager.UpdateMember.
I did try performing a call to MaiChimpManager.GetMemberInfo and then passing the data that was returned by this method straight back to subscribe or UpdateMember but the same error occurs which makes me ponder if there is an underlying issue with the wrapper (it's far more likely my code mind you!).
The code I am using is:
Thanks in advance! :-)
The text was updated successfully, but these errors were encountered: