brandonseydel / mailchimp.net Goto Github PK
View Code? Open in Web Editor NEWMail Chimp 3.0 Wrapper
License: MIT License
Mail Chimp 3.0 Wrapper
License: MIT License
Hi,
in many (but not all) Logic.cs files, for example ActivityLogic.cs, the GetAllAsync() has the parameter request = null if not passed.
But few line below its used with request.ToQueryString() that throw an null pointer exception.
It's correct this behaviour or I missing something?
Thanks
Add line Task<SendChecklistResponse> SendChecklistAsync(string id);
to ICampaignLogic.
Hello!
I have one ECommerceStores.Cart that was created by ECommerceStores.Carts("storeid").AddAsync(mcCart).
When I try ECommerceStores.Carts("storeid").GetAsync("id") then it works right.
But when I try ECommerceStores.Carts("some_storeid").GetAllAsync() then it does not work. I am getting error: "Error converting value {null} to type 'System.DateTime'. Path 'carts[0].created_at'".
Thanks
At the moment, when a request is built, only enums have special treatment in the ToQueryString() method in BaseRequest.cs.
DateTimes require special treatment because MailChimp requires the date to be passed in the format: yyyy-MM-dd HH:mm:ss. Without this, requests that contain dates (such as the CampaignRequest date fields) are ignored.
To workaround this, I added the following lines to BaseRequest.cs at line 78:
if (type == typeof(DateTime))
{
value = ((DateTime) value).ToString("yyyy-MM-dd HH:mm:ss");
}
Not sure if this is the best way of handling it so I haven't submitted a request.
The enum value for DoesNotContain should be "notcontain" and not "notcontains". This is around line 49 in Operator.cs. I can't find the definitive list in the API docs but was getting a missing enum exception until I changed this.
Calling MailchimpManager.Members.GetActivitiesAsync with only listId and email results on an unhandled Exception.Not tested but you'll get the same result when GetGoalsAsync is called. Check pull request #25 .
https://www.nuget.org/packages/MailChimp.Net.V3/
Would be useful if you listed Newtonsoft.Json as a dependency on Nuget - more specifically the version :)
Hi, not sure if this is me or not but so far I have had no success using this wrapper:
After much head scratching I have finally managed to deduce that the reason MC keeps telling me I haven't supplied required data is that the json going through as the content in an Lists.AddOrUpdateAsync call is formatted as follows when viewed in wireshark:
Object
Member Key: "k_BackingField"
Member Key: "k_BackingField"
etc.
My code is ultimately going to be a WCF service but at the moment I am using a WinForms test harness so I don't have a GlobalConfiguration to set JsonSerializerSettings on....
Any clues?
Since calls such as GetSentToRecipientsAsync return the IEnumerable of the sent_to directly (without a wrapping object), there are fields such as "total_items" available in the response which are not available (this is the total number of items retrieved regardless of pagination parameters). Exposing these returned parameters would be useful when you are trying to page through a long list of recipients.
In the case above, there is already a SentToResponse (although this does not currently contain the "total_items" return value) but this is discarded inside the API. I would suggest adding the extra return values and returning the SentToResponse from the api call rather than returning sendToResponse.Recipients.
The documentation for this call can be seen here:
http://developer.mailchimp.com/documentation/mailchimp/reference/reports/sent-to/
The recent change of Campaign.Type from string to enum has broken the campaign update code as a Null value exception is thrown:
StringEnumDescriptionConverter.WriteJson needs
var type = value.GetType();
var name = Enum.GetName(type, value);
if (name != null)
{
var description = type.GetField(name) // I prefer to get attributes this way
.GetCustomAttributes(false)
.OfType()
.Select(x => x.Description)
.SingleOrDefault();
writer.WriteValue(description ?? name);
}
I would submit a pull request but my master branch is in such a mess it's probably less work for you to do it and me to delete my fork and start again. Sorry :)
I only wanted top 50 campaigns for a list but sort_field and sort_order were not implemented.
I am adding new enums for CampaignRequest.
The issue happens when you get a list of campaigns viaCampaignLogic.GetAll()
and the campaigns are having different Segment Type
for a Condition
As explained in the API reference http://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/# the Type
of value property Condition
is not fixed.
In 'Mailhimp.Net.Models.Condition' Value
type is string
but in it's only determined at runtime what is the actual type for Condition.Value
For e.g.
A campaign returned via json as shown in the images attached below:
In the class BatchLogic there is no way to do a batch delete.
If you, for instance, want to delete members from a list you can use the method DeleteAsync in the class ListLogic but there is no way to do it in batch. Or am I missing something?
I'm trying to get a member (through Members.GetAsync(listId, emailAddress)
) from mailchimp to which I've written a note manually on the mailchimp site, and then I get this error:
Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.IEnumerable'1[System.Object]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly. To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object. Path 'last_note.note_id', line 1, position 579.
Any thoughts?
IMailChimpManager does not include InterestCategories, Interests etc.
ListRequest class does not have offset / limit.
When I try to use Lits.GetAllAsync, it will only return max 10 entries.
It seems like its not possible to GET member by mergefield |UNIQUEID| value.
Is it implemented?
According to MC its done:
To GET a member based on their UNIQUEID you can do a GET to lists/{list_id}/members?unique_email_id={UNIQUEID}. This will then filter by and return that specific subscriber.
Hello,
I'm trying to get members that belong to a ListSegment. I can get members from Lists perfectly fine, but when making the ListSegments.GetMemberResponseAsync(listId, segmentId) call, the result always has a count of 0. Same thing happens with GetAllMembersAsync().
When making the same GET call with PostMan, the proper members are returned.
Do you have any insight into why this is?
Thanks,
Michael
Hey there,
I've run into an issue where if I call the MemberLogic.GetResponseAsync() method and any of the members have an Address type MergeField with any characters in it, an error is thrown. If there is an Address type MergeField but they are all empty, the error is not thrown.
If we call MailChimp's API correctly, they give us valid JSON.
Here is the error:
Unexpected character encountered while parsing value: {. Path 'members[0].merge_fields.MMERGE3', line 1, position 233.
at Newtonsoft.Json.JsonTextReader.ReadStringValue(ReadType readType)
at Newtonsoft.Json.JsonTextReader.ReadAsString()
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateDictionary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, Encoding effectiveEncoding, IFormatterLogger formatterLogger)
at System.Net.Http.Formatting.JsonMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, Encoding effectiveEncoding, IFormatterLogger formatterLogger)
at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger)
at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.ReadFromStreamAsync(Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.Http.HttpContentExtensions.<ReadAsAsyncCore>d__0`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MailChimp.Net.Logic.MemberLogic.<GetResponseAsync>d__6.MoveNext()
One of the actions for an EmailActivity is "bounce". When the action is bounce, the type will either be "soft" or "hard".
/// <summary>
/// Gets or sets the type of bounce.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }
Using the following method:
Task GetAsync(string listId, string emailAddress, BaseRequest request = null)
throws an exception if the member does not exist. Would expect it to return null as the api itself should return 404.
I'm writing here more for help than declaring this an issue as I'm pretty sure this is more related to my lack of experience with async methods.
I am moving my organization to MC, and trying to create a wrapper class in my business logic to pass other business objects into it, and then utilize your methods. I have been able to run GetAll() methods and return data from MailChimp, but have not been able to create lists or members.
Here's a sample of my code:
public class myChimp
{
private MailChimp.Net.MailChimpManager account { get; set; }
public AIAChimp()
{
account = new MailChimp.Net.MailChimpManager("defaultAPIKey");
}
public AIAChimp(string apiKey)
{
account = new MailChimp.Net.MailChimpManager(apiKey);
}
public async System.Threading.Tasks.Task<IEnumerable<MailChimp.Net.Models.List>> GetLists()
{
var listCollection = await account.Lists.GetAllAsync().ConfigureAwait(false);
return listCollection;
}
public async System.Threading.Tasks.Task<MailChimp.Net.Models.List> CreateList(string listName)
{
var list = new MailChimp.Net.Models.List { Name = listName,
PermissionReminder = "default",
CampaignDefaults = { FromEmail = "[email protected]",
FromName = "myCompany" }, Contact = { Company = "myCompany" } };
return await account.Lists.AddOrUpdateAsync(list).ConfigureAwait(false);
}
}
So with that, when I run these commands, the first works, and these second one throws an error at t2.Wait(), site a null value:
myChimp c = new myChimp();
System.Threading.Tasks.Task<IEnumerable<MailChimp.Net.Models.List>> t = c.GetLists();
t.Wait();
foreach (MailChimp.Net.Models.List list in t.Result)
{
id = list.Id;
Console.WriteLine(list.Name + " - " + list.DateCreated + " - " + list.Id + " - " + list.Stats.MemberCount);
}
System.Threading.Tasks.Task<MailChimp.Net.Models.List> t2 = c.CreateList("All US Staff");
t2.Wait();
Console.WriteLine(t1.Result.Id);
Right now, I am using a Free Account. I can also see errors in the API Status of my account for /PUT stating "The requested resource could not be found."
Both GetAllSync and GetResponseAsync take a QueryableBaseRequest as a parameter but this is an abstract class. I cannot see a derived class that would be suitable here.
There also seem to be very little difference between these two methods....can you clarify their intended uses?
Cheers
Thank you for the work you've done.
I cloned your repo and noticed that add interest is not added, there is minor iterations that should be added to make this work, find below code snippet if you would like to add it to your branch.
public async Task<Interest> AddOrUpdateAsync(Interest list)
{
using (var client = this.CreateMailClient("lists/"))
{
System.Net.Http.HttpResponseMessage response;
if (string.IsNullOrWhiteSpace(list.Id))
{
response = await client.PostAsJsonAsync(
$"{list.ListId}/interest-categories/{list.InterestCategoryId}/interests",
list).ConfigureAwait(false);
}
else
{
response = await client.PatchAsJsonAsync(
$"{list.ListId}/interest-categories/{list.InterestCategoryId}/interests/{list.Id}",
list).ConfigureAwait(false);
}
await response.EnsureSuccessMailChimpAsync().ConfigureAwait(false);
return await response.Content.ReadAsAsync<Interest>().ConfigureAwait(false);
}
}
I believe the URLs are slightly off here as according to the documentation it should be:
POST /lists/{list_id}/segments/{segment_id}/members
But it looks like the code is missing the /members
Campaign create is assigned with "PUT" action but that is "POST"
{"type":"http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/","title":"Invalid Resource","status":400,"detail":"The resource submitted could not be validated. For field-specific details, see the 'errors' array.","instance":"","errors":[{"field":"options.default_country","message":"Schema describes integer, string found instead"}]}
Hi,
Im trying to do a batch update of users in a list with the help of your wrapper but I quite don't understand how to do it.
Any advice?
In older versions we can create template like this
MailChimp.Templates.TemplateAddResult result = mailChimpManager.AddTemplate(mailTemplates.TemplateName, mailTemplates.HTMLContent);
Can someone help me?
Hi,
not sure if this is an issue with your API or MailChimp's API.
When I add a new member with status set to pending, that member is added as subscribed.
var member = new Member { EmailAddress = email, Status = Status.Pending }; member.MergeFields = new Dictionary<string, string>(); member.MergeFields.Add("FNAME", "koga-test"); var result = await manager.Members.AddOrUpdateAsync(listId, member);
The result returns a member with subscribed status, but status pending is expected.
The ConvertsatonTest.cs has the CampgaignTest and the CampaignTest.cs has the ConversationTest
fyi
It looks like all the calls in InterestCategoryLogic are missing the "interest-categories" path in the request URLs.
Throws exception:
Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: {. Path 'members[21].merge_fields.MMERGE3', line1, position 52056.
Tested on multiple lists.
Result StackTrace:
at Newtonsoft.Json.JsonTextReader.ReadStringValue(ReadType readType)
at Newtonsoft.Json.JsonTextReader.ReadAsString()
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateDictionary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, Encoding effectiveEncoding, IFormatterLogger formatterLogger)
at System.Net.Http.Formatting.JsonMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, Encoding effectiveEncoding, IFormatterLogger formatterLogger)
at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger)
at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.ReadFromStreamAsync(Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.Http.HttpContentExtensions.d__01.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MailChimp.Net.Logic.MemberLogic.<GetAllAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter
1.GetResult()
at ParasolCo.Service.Mailing.MailingProcessor.d__4.MoveNext() in C:\Development\ParasolCo\Source\ParasolCo.Service\Integrations\Mailing\MailingProcessor.cs:line 40
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at ParasolCo.Service.MailingService.<GetListMembers>d__5.MoveNext() in C:\Development\ParasolCo\Source\ParasolCo.Service\Services\MailingService.cs:line 54 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter
1.GetResult()
at ParasolCo.Service.PaymentServiceTests.AdminTools.d__23.MoveNext() in C:\Development\ParasolCo\Source\ParasolCo.Test\Admin\AdminTools.cs:line 592
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Result Message:
Test method ParasolCo.Service.PaymentServiceTests.AdminTools.CombineMailingList threw exception:
Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: {. Path 'members[21].merge_fields.MMERGE3', line 1, position 52056.
Would like to start writing some logic so I can automate more testing. There is a little bit, but I need quite a bit more tests. Code coverage is very low.
Hi brandonseydel,
You had created a great MailChimp.Net Wrapper. Campaign and List is worked for me in MVC .NET. But I have a problem with Template that when I call Templates.GetAllAsync() function it always throw "Could not convert string to integer: 925cbacdd4. Path 'templates[6].folder_id', line 1, position 7029." Exception. I got the same problem when I call "TemplateFolders.GetAllAsync()". Anyone faced with this problem, please help me to solve this problem.
This is my code:
> line 1: IMailChimpManager mcManager = new MailChimpManager();
> line 2: var mcTemplates = await mcManager.Templates.GetAllAsync().ConfigureAwait(false);
Thanks,
Hi
Task UpdateAsync(string productId, Product product);
in EcommerceProductLogic can be removed. There is no update method for product only for variants. I chatted with the mailchimp support and the will probably at it.. but for now we have to remove product and add it again if we do changes on a product, like titel or vendor.
I can't see where I can reach IECommerceProductVarianceLogic, so I can change, add, delete variants from product.
I added a HttpClientHandler to the HttpClient in BaseLogic.CreateMailClient(string resource) and my network traffic size improved by at least 5x. That is - it was at least 5 time smaller.
HttpClientHandler handler = new HttpClientHandler(); if (handler.SupportsAutomaticDecompression) handler.AutomaticDecompression = System.Net.DecompressionMethods.GZip | System.Net.DecompressionMethods.Deflate; var client = new HttpClient(handler) { BaseAddress = new Uri($"https://{this.DataCenter}.api.mailchimp.com/3.0/{resource}") };
See the "Using automatic decompression with HttpClient" section of https://blogs.msdn.microsoft.com/dotnet/2013/06/06/portable-compression-and-httpclient-working-together/.
Hi Brandon,
There appears to be data mismatch for Models.Campaign.Tracking.GoogleAnalytics (bool?) which is defined in V3 documentation(http://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/) as a string.
I am receiving the following json error:
Could not convert string to boolean: UA-xxxxxxxx-xx. Path 'campaigns[0].tracking.google_analytics', line 1, position 1232.
Maybe GetActiviviesAsync should be public instead of private?
private async Task<IEnumerable> GetActivitiesAsync(...)
I have used the example "Adding User To List" from readme.
public async Task<Member> AddMemberToList()
{
var listId = "TestListId";
var member = new Member { EmailAddress = $"[email protected]", Status = Status.Subscribed };
member.MergeFields.Add("FNAME", "HOLY");
member.MergeFields.Add("LNAME", "COW");
var result = await this.mailChimpManager.Members.AddOrUpdateAsync(listId, member);
return result;
}
but when I request this method, it fails when I include the merge fields.
var t = helper.AddMemberToList();
t.Wait();
For the list I have also ensure it has the fields "FNAME" and "LNAME".
Why does the part fails?
Furthermore I have previous used this Mailchimp API wrapper https://github.com/danesparza/MailChimp.NET where it has option for the Double Opt-in Process: http://kb.mailchimp.com/lists/signup-forms/the-double-opt-in-process .. e.g. send a confirmation e-mail where it first added the member to the list when its has been confirmed in the email ... and you could also specify it should send an "welcome" email. How to do these things with this Mailchimp wrapper?
Hi,
I'm trying to figure out how to attach an existing template (by template_Id) to a new campaign and send it. I've tried Campaign.Setting.TemplateId with no luck.
I also tried setting campaign's content using Template.Id, after the campaign is created. Still, no luck.
This one doesn't work either:
var contentRequest = manager.Templates.GetAsync(_Template_Id);
Template _fetchedTemplate = contentRequest.Result;
var _result2 = manager.Content.AddOrUpdateAsync(_Campaign_Id, new MailChimp.Net.Core.ContentRequest { Template = _fetchedTemplate } );
Thanks!
Hello
I am trying to run a campaign. For that I am setting a template to campaign . But my campaign id is bigger than normal integer. So its giving
System.OverflowException: Value was either too large or too small for an Int16. Value was either too large or too small for an Int16.
ContentTemplate template = new ContentTemplate()
{
id = "128697" //Put your template id that you want to use
};
Can you please check it for me?
Thanks and Regards
Roopesh
The 1.5.4 package doesnt seem to be working for me, when working with lists.
Not sure why yet, but if I downgrade back to 1.5.3 all my tests go green again. Will investigate, but thought I d give you a heads up.
Hi
I'm converting to MailChimp v.3 with this great API and use Ecommerce Store with orders and products. I just started mapping things over and saw that shipping_total, tracking_code, shipping_address and billing_address is missing in the Order class.
I have a problem when I get all message of a conversation by conversationId=b2f3134856. This conversation has only a message from subscriber.
This is my code:
line 1: IMailChimpManager mcManager = new MailChimpManager();
line 2: var messages = await mcManager.Messages.GetAllAsync("b2f3134856").ConfigureAwait(false);
The "messages" response at line 2 have Count=10 (message). I see that all message is from another conversation which from another deleted campaign. Anything wrong from MailChimp response; anyone faced with the same problem can help me to solve it.
Thanks,
Calling MailChimpManager.InterestCategories.GetAllAsync with a valid ListId returns an IEnumerable, with null ListId and Id properties. Adding private setters on both properties solves this issue. Check PR #25
I have noticed there is no implementation for
'URL : POST /campaigns/{campaign_id}/actions/test'
Data : '{"test_emails":["[email protected]"],"send_type":"html"}'
I am working on it now and will push it as soon it's ready.
Hi,
Would it be possible to add additional filter parameters to the CampaignRequest object?
All the valid parameters are available here: http://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/#read-get_campaigns
and I currently rely on some of the date fields such as "since_send_time" and "since_create_time".
Thanks!
Gav
If you invoke MailchimpManager.Members.GetAsync result Member class has all Stats properties set to default values or null.
Found that ClickRate and OpenRate, maybe should be AvgClickRate and AvgOpenRate instead.
Mailchimp v3 documentation only states properties avg_click_rate and avg_open_rate. All other properties in Stats class are not in v3 documentation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.