Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events v1 #48

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion createsend-dotnet.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata>
<id>campaignmonitor-api</id>
<title>Campaign Monitor</title>
<version>4.2.2</version>
<version>5.0.0</version>
<authors>Campaign Monitor</authors>
<description>A .NET library for the Campaign Monitor API with enhancements for Transactional</description>
<licenseUrl>http://opensource.org/licenses/mit-license</licenseUrl>
Expand Down
35 changes: 35 additions & 0 deletions createsend-dotnet/Event.cs
Original file line number Diff line number Diff line change
@@ -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<BasicEvent, BasicEventResult>(
auth, string.Format("/events/{0}/track", clientID), null,
new BasicEvent()
{
EventName = eventName,
ContactID = new ContactID { Email = emailAddress },
Data = data
});
}
}
}
24 changes: 24 additions & 0 deletions createsend-dotnet/Models/Event.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}
4 changes: 2 additions & 2 deletions createsend-dotnet/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
2 changes: 2 additions & 0 deletions createsend-dotnet/createsend-dotnet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
<Compile Include="CreateSendOptions.cs" />
<Compile Include="CreateSendOptionsWrapper.cs" />
<Compile Include="CustomCreateSendOptions.cs" />
<Compile Include="Event.cs" />
<Compile Include="General.cs" />
<Compile Include="ICreateSendOptions.cs" />
<Compile Include="List.cs" />
Expand All @@ -65,6 +66,7 @@
<Compile Include="Models\Client.cs" />
<Compile Include="HttpHelper.cs" />
<Compile Include="Models\EmailClient.cs" />
<Compile Include="Models\Event.cs" />
<Compile Include="Models\ExternalSession.cs" />
<Compile Include="Models\List.cs" />
<Compile Include="Models\OAuthTokenDetails.cs">
Expand Down