Skip to content
Merged
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
34 changes: 17 additions & 17 deletions docker/readme.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
## Build & Deploy via Docker & Nuget
This docker container will pull the latest version of this library, create a nuget package, and deploy it to Nuget.
The only thing is needs is a valid Nuget API key, from someone that has rights to publish the package to Nuget.
```
cd docker
docker build . # this will produce a hash key, say 12345678
docker run -e "APIKEY=your_nuget_key_here" 12345678
```
This container has been registered on Docker Hub, and can be run like so:
```
docker run -e "APIKEY=your_nuget_key_here" darrencauthon/csharp-sparkpost
```
## Build & Deploy via Docker & Nuget

This docker container will pull the latest version of this library, create a nuget package, and deploy it to Nuget.

The only thing is needs is a valid Nuget API key, from someone that has rights to publish the package to Nuget.

```
cd docker
docker build . # this will produce a hash key, say 12345678
docker run -e "APIKEY=your_nuget_key_here" 12345678
```

This container has been registered on Docker Hub, and can be run like so:

```
docker run -e "APIKEY=your_nuget_key_here" darrencauthon/csharp-sparkpost
```
224 changes: 112 additions & 112 deletions src/SparkPost.Portable/SparkPost.Portable.csproj
Original file line number Diff line number Diff line change
@@ -1,113 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2F7E9E0B-27BB-42AC-AB4A-B8249B64C654}</ProjectGuid>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>SparkPost</RootNamespace>
<AssemblyName>SparkPost.Portable</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;PORTABLE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<NoStdLib>false</NoStdLib>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<DefineConstants>PORTABLE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<NoStdLib>false</NoStdLib>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\SparkPost\Address.cs">
<Link>Address.cs</Link>
</Compile>
<Compile Include="..\SparkPost\Attachment.cs">
<Link>Attachment.cs</Link>
</Compile>
<Compile Include="..\SparkPost\CcHandling.cs">
<Link>CcHandling.cs</Link>
</Compile>
<Compile Include="..\SparkPost\Client.cs">
<Link>Client.cs</Link>
</Compile>
<Compile Include="..\SparkPost\Content.cs">
<Link>Content.cs</Link>
</Compile>
<Compile Include="..\SparkPost\DataMapper.cs">
<Link>DataMapper.cs</Link>
</Compile>
<Compile Include="..\SparkPost\File.cs">
<Link>File.cs</Link>
</Compile>
<Compile Include="..\SparkPost\IClient.cs">
<Link>IClient.cs</Link>
</Compile>
<Compile Include="..\SparkPost\InlineImage.cs">
<Link>InlineImage.cs</Link>
</Compile>
<Compile Include="..\SparkPost\ITransmissions.cs">
<Link>ITransmissions.cs</Link>
</Compile>
<Compile Include="..\SparkPost\Options.cs">
<Link>Options.cs</Link>
</Compile>
<Compile Include="..\SparkPost\Recipient.cs">
<Link>Recipient.cs</Link>
</Compile>
<Compile Include="..\SparkPost\RecipientType.cs">
<Link>RecipientType.cs</Link>
</Compile>
<Compile Include="..\SparkPost\Request.cs">
<Link>Request.cs</Link>
</Compile>
<Compile Include="..\SparkPost\RequestSender.cs">
<Link>RequestSender.cs</Link>
</Compile>
<Compile Include="..\SparkPost\Response.cs">
<Link>Response.cs</Link>
</Compile>
<Compile Include="..\SparkPost\ResponseException.cs">
<Link>ResponseException.cs</Link>
</Compile>
<Compile Include="..\SparkPost\SendTransmissionResponse.cs">
<Link>SendTransmissionResponse.cs</Link>
</Compile>
<Compile Include="..\SparkPost\Transmission.cs">
<Link>Transmission.cs</Link>
</Compile>
<Compile Include="..\SparkPost\Transmissions.cs">
<Link>Transmissions.cs</Link>
</Compile>
<Compile Include="PortableReflectionExtensions.cs" />
<Compile Include="..\SparkPost\Properties\AssemblyInfo.cs">
<Link>Properties\AssemblyInfo.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.8.0.2\lib\portable-net45+wp80+win8+wpa81+dnxcore50\Newtonsoft.Json.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="..\SparkPost\SparkPost.nuspec">
<Link>SparkPost.nuspec</Link>
</None>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2F7E9E0B-27BB-42AC-AB4A-B8249B64C654}</ProjectGuid>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>SparkPost</RootNamespace>
<AssemblyName>SparkPost.Portable</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;PORTABLE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<NoStdLib>false</NoStdLib>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<DefineConstants>PORTABLE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<NoStdLib>false</NoStdLib>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\SparkPost\Address.cs">
<Link>Address.cs</Link>
</Compile>
<Compile Include="..\SparkPost\Attachment.cs">
<Link>Attachment.cs</Link>
</Compile>
<Compile Include="..\SparkPost\CcHandling.cs">
<Link>CcHandling.cs</Link>
</Compile>
<Compile Include="..\SparkPost\Client.cs">
<Link>Client.cs</Link>
</Compile>
<Compile Include="..\SparkPost\Content.cs">
<Link>Content.cs</Link>
</Compile>
<Compile Include="..\SparkPost\DataMapper.cs">
<Link>DataMapper.cs</Link>
</Compile>
<Compile Include="..\SparkPost\File.cs">
<Link>File.cs</Link>
</Compile>
<Compile Include="..\SparkPost\IClient.cs">
<Link>IClient.cs</Link>
</Compile>
<Compile Include="..\SparkPost\InlineImage.cs">
<Link>InlineImage.cs</Link>
</Compile>
<Compile Include="..\SparkPost\ITransmissions.cs">
<Link>ITransmissions.cs</Link>
</Compile>
<Compile Include="..\SparkPost\Options.cs">
<Link>Options.cs</Link>
</Compile>
<Compile Include="..\SparkPost\Recipient.cs">
<Link>Recipient.cs</Link>
</Compile>
<Compile Include="..\SparkPost\RecipientType.cs">
<Link>RecipientType.cs</Link>
</Compile>
<Compile Include="..\SparkPost\Request.cs">
<Link>Request.cs</Link>
</Compile>
<Compile Include="..\SparkPost\RequestSender.cs">
<Link>RequestSender.cs</Link>
</Compile>
<Compile Include="..\SparkPost\Response.cs">
<Link>Response.cs</Link>
</Compile>
<Compile Include="..\SparkPost\ResponseException.cs">
<Link>ResponseException.cs</Link>
</Compile>
<Compile Include="..\SparkPost\SendTransmissionResponse.cs">
<Link>SendTransmissionResponse.cs</Link>
</Compile>
<Compile Include="..\SparkPost\Transmission.cs">
<Link>Transmission.cs</Link>
</Compile>
<Compile Include="..\SparkPost\Transmissions.cs">
<Link>Transmissions.cs</Link>
</Compile>
<Compile Include="PortableReflectionExtensions.cs" />
<Compile Include="..\SparkPost\Properties\AssemblyInfo.cs">
<Link>Properties\AssemblyInfo.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.8.0.2\lib\portable-net45+wp80+win8+wpa81+dnxcore50\Newtonsoft.Json.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="..\SparkPost\SparkPost.nuspec">
<Link>SparkPost.nuspec</Link>
</None>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
</Project>
2 changes: 1 addition & 1 deletion src/SparkPost.Tests/ClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void Setup()
[Test]
public void It_should_default_to_the_library_version()
{
Subject.UserAgent.ShouldEqual($"csharp-sparkpost/1.14.0");
Subject.UserAgent.ShouldEqual($"csharp-sparkpost/1.15.0");
}

[Test]
Expand Down
2 changes: 1 addition & 1 deletion src/SparkPost.Tests/MessageEventsQueryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void It_should_have_a_defualt_campaign_ids_list()
[Test]
public void It_should_have_a_default_friendly_froms_list()
{
new MessageEventsQuery().FriendlyFroms.ShouldNotBeNull();
new MessageEventsQuery().FromAddresses.ShouldNotBeNull();
}

[Test]
Expand Down
7 changes: 7 additions & 0 deletions src/SparkPost/BounceClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ public enum BounceClass
/// </summary>
AdminFailure = 25,

/// <summary>
/// Smart Send Suppression
/// The message was suppressed by Smart Send policy.
/// Category: Admin.
/// </summary>
SmartSendSuppression = 26,

/// <summary>
/// Generic Bounce: No RCPT
/// No recipient could be determined for the message.
Expand Down
11 changes: 5 additions & 6 deletions src/SparkPost/DataMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,14 @@ public IDictionary<string, object> ToDictionary(MessageEventsQuery query)
return WithCommonConventions(query, new Dictionary<string, object>()
{
["events"] = string.Join(",", query.Events),
["campaign_ids"] = string.Join(",", query.CampaignIds),
["campaigns"] = string.Join(",", query.CampaignIds),
["bounce_classes"] = string.Join(",", query.BounceClasses),
["campaign_ids"] = string.Join(",", query.CampaignIds),
["friendly_froms"] = string.Join(",", query.FriendlyFroms),
["message_ids"] = string.Join(",", query.MessageIds),
["from_addresses"] = string.Join(",", query.FromAddresses),
["messages"] = string.Join(",", query.MessageIds),
["recipients"] = string.Join(",", query.Recipients),
["subaccounts"] = string.Join(",", query.Subaccounts),
["template_ids"] = string.Join(",", query.TemplateIds),
["transmission_ids"] = string.Join(",", query.TransmissionIds)
["templates"] = string.Join(",", query.TemplateIds),
["transmissions"] = string.Join(",", query.TransmissionIds)
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/SparkPost/ListMessageEventsResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ public class ListMessageEventsResponse : Response
public ListMessageEventsResponse()
{
MessageEvents = new MessageEvent[] {};
Links = new PageLink[] {};
Links = new PageLink();
}

public IEnumerable<MessageEvent> MessageEvents { get; set; }

public IList<PageLink> Links { get; set; }
public PageLink Links { get; set; }

public int TotalCount { get; set; }
}
Expand Down
6 changes: 0 additions & 6 deletions src/SparkPost/MessageEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,6 @@ public BounceClass BounceClassEnum
/// </summary>
public string SendingIp { get; set; }

/// <summary>
/// Not documented.
/// "tdate": "2016-04-27T22:05:40.000Z",
/// </summary>
public DateTime TDate { get; set; }

/// <summary>
/// Not documented.
/// "transactional": "1",
Expand Down
30 changes: 29 additions & 1 deletion src/SparkPost/MessageEventType.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace SparkPost
{
// Values taken from:
// https://developers.sparkpost.com/api/#/reference/message-events/message-events
// https://developers.sparkpost.com/api/events/
// Additional values and descriptions taken from:
// https://support.sparkpost.com/customer/portal/articles/1976204-webhook-event-reference

Expand Down Expand Up @@ -61,6 +61,34 @@ public enum MessageEventType
/// </summary>
Open,

/// <summary>
/// initial_open
/// Initial Open.
/// Recipient opened a message in a mail client, thus rendering a tracking pixel at the top of the message.
/// </summary>
InitialOpen,

/// <summary>
/// amp_click
/// AMP Click.
/// Recipient clicked a tracked link in an AMP message, thus prompting a redirect through the SparkPost click-tracking server to the link's destination.
/// </summary>
AmpClick,

/// <summary>
/// amp_open
/// AMP Open.
/// Recipient opened an AMP message in a mail client, thus rendering a tracking pixel at the bottom of the message.
/// </summary>
AmpOpen,

/// <summary>
/// amp_initial_open
/// AMP Initial Open.
/// Recipient opened an AMP message in a mail client, thus rendering a tracking pixel at the top of the message.
/// </summary>
AmpInitialOpen,

/// <summary>
/// click
/// Click.
Expand Down
Loading