diff --git a/HISTORY.md b/HISTORY.md index 08c05bd..37b3d62 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,9 @@ # createsend-dotnet history +## v5.0.0 - 16 May, 2017 + +* Events API added to the dotnet 4 wrapper + ## v4.2.2 - 8 Oct, 2015 * Actually upgraded the createsend package set to Nuget diff --git a/createsend-dotnet.nuspec b/createsend-dotnet.nuspec index ddf4774..427c619 100644 --- a/createsend-dotnet.nuspec +++ b/createsend-dotnet.nuspec @@ -3,7 +3,7 @@ campaignmonitor-api Campaign Monitor - 4.2.2 + 5.0.0 Campaign Monitor A .NET library for the Campaign Monitor API with enhancements for Transactional http://opensource.org/licenses/mit-license diff --git a/createsend-dotnet/Event.cs b/createsend-dotnet/Event.cs new file mode 100644 index 0000000..623842d --- /dev/null +++ b/createsend-dotnet/Event.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace createsend_dotnet +{ + public class Event : CreateSendBase + { + public string ClientID { get; set; } + + public Event(AuthenticationDetails auth, string clientID) + : base(auth) + { + ClientID = clientID; + } + + public static BasicEventResult Track( + AuthenticationDetails auth, + string clientID, + string eventName, + string emailAddress, + object data) + { + return HttpHelper.Post( + auth, string.Format("/events/{0}/track", clientID), null, + new BasicEvent() + { + EventName = eventName, + ContactID = new ContactID { Email = emailAddress }, + Data = data + }); + } + } +} diff --git a/createsend-dotnet/Models/Event.cs b/createsend-dotnet/Models/Event.cs new file mode 100644 index 0000000..2911813 --- /dev/null +++ b/createsend-dotnet/Models/Event.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace createsend_dotnet +{ + public class ContactID + { + public string Email { get; set; } + } + + public class BasicEvent + { + public ContactID ContactID { get; set; } + public string EventName { get; set; } + public object Data { get; set; } + } + + public class BasicEventResult + { + public string EventID { get; set; } + } +} diff --git a/createsend-dotnet/Properties/AssemblyInfo.cs b/createsend-dotnet/Properties/AssemblyInfo.cs index 7042abb..c9140dd 100644 --- a/createsend-dotnet/Properties/AssemblyInfo.cs +++ b/createsend-dotnet/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("4.2.2.0")] -[assembly: AssemblyFileVersion("4.2.2.0")] +[assembly: AssemblyVersion("5.0.0.0")] +[assembly: AssemblyFileVersion("5.0.0.0")] diff --git a/createsend-dotnet/createsend-dotnet.csproj b/createsend-dotnet/createsend-dotnet.csproj index 3558a36..394c4f5 100644 --- a/createsend-dotnet/createsend-dotnet.csproj +++ b/createsend-dotnet/createsend-dotnet.csproj @@ -55,6 +55,7 @@ + @@ -65,6 +66,7 @@ +