diff options
author | CJ Buchmann <cj.buchmann@sendgrid.com> | 2012-01-09 14:20:11 -0800 |
---|---|---|
committer | CJ Buchmann <cj.buchmann@sendgrid.com> | 2012-01-09 14:20:11 -0800 |
commit | 340c62e176b6f97ac3250d8fe2427d1bfedd8f8a (patch) | |
tree | 3243a11f0c95486dc5edbe7221094d0bffa8b7b3 | |
parent | 8282e3c24573cdabe29069d0018147ab324856b8 (diff) | |
download | sendgrid-csharp-340c62e176b6f97ac3250d8fe2427d1bfedd8f8a.zip sendgrid-csharp-340c62e176b6f97ac3250d8fe2427d1bfedd8f8a.tar.gz sendgrid-csharp-340c62e176b6f97ac3250d8fe2427d1bfedd8f8a.tar.bz2 |
Added Enable apps methods. Still need to validate certain functionality
-rwxr-xr-x | SendGrid/SendGrid/ISendGrid.cs | 4 | ||||
-rwxr-xr-x | SendGrid/SendGrid/SendGrid.cs | 49 | ||||
-rwxr-xr-x | SendGrid/Tests/Tests.csproj | 4 |
3 files changed, 45 insertions, 12 deletions
diff --git a/SendGrid/SendGrid/ISendGrid.cs b/SendGrid/SendGrid/ISendGrid.cs index 20e7114..f3b7519 100755 --- a/SendGrid/SendGrid/ISendGrid.cs +++ b/SendGrid/SendGrid/ISendGrid.cs @@ -68,7 +68,7 @@ namespace SendGrid void DisableGoogleAnalytics();
void DisableTemplate();
void DisableBcc();
- void DisableBipassListManaement();
+ void DisableBypassListManagement();
void EnableGravatar();
void EnableOpenTracking();
@@ -79,7 +79,7 @@ namespace SendGrid void EnableGoogleAnalytics(String source, String medium, String term, String content = null, String campaign = null);
void EnableTemplate(String html = null);
void EnableBcc(String email = null);
- void EnableBipassListManaement();
+ void EnableBypassListManagement();
#endregion
void Mail();
diff --git a/SendGrid/SendGrid/SendGrid.cs b/SendGrid/SendGrid/SendGrid.cs index 6f6e995..ec8f916 100755 --- a/SendGrid/SendGrid/SendGrid.cs +++ b/SendGrid/SendGrid/SendGrid.cs @@ -1,5 +1,6 @@ using System;
using System.Collections.Generic;
+using System.Globalization;
using System.Linq;
using System.Net.Mail;
using System.Text;
@@ -272,42 +273,72 @@ namespace SendGrid public void EnableClickTracking(string text = null)
{
- throw new NotImplementedException();
+ var filter = Filters.ClickTracking.ToString();
+
+ this.header.Enable(filter);
+ this.header.AddFilterSetting(filter, new List<string>(){ "text" }, text);
}
public void EnableSpamCheck(int score = 5, string url = null)
{
- throw new NotImplementedException();
+ var filter = Filters.SpamCheck.ToString();
+
+ this.header.Enable(filter);
+ this.header.AddFilterSetting(filter, new List<string>(){ "score" }, score.ToString(CultureInfo.InvariantCulture));
+ this.header.AddFilterSetting(filter, new List<string>(){ "url" }, url);
}
public void EnableUnsubscribe(string text, string html, string replace, string url, string landing)
{
- throw new NotImplementedException();
+ var filter = Filters.Unsubscribe.ToString();
+
+ this.header.Enable(filter);
+ this.header.AddFilterSetting(filter, new List<string>(){ "text" }, text);
+ this.header.AddFilterSetting(filter, new List<string>(){ "html" }, html);
+ this.header.AddFilterSetting(filter, new List<string>(){ "replace"}, replace);
+ this.header.AddFilterSetting(filter, new List<string>(){ "landing" }, landing);
}
public void EnableFooter(string text = null, string html = null)
{
- throw new NotImplementedException();
+ var filter = Filters.Footer.ToString();
+
+ this.header.Enable(filter);
+ this.header.AddFilterSetting(filter, new List<string>(){ "text" }, text);
+ this.header.AddFilterSetting(filter, new List<string>(){ "html" }, html);
}
public void EnableGoogleAnalytics(string source, string medium, string term, string content = null, string campaign = null)
{
- throw new NotImplementedException();
+ var filter = Filters.GoogleAnalytics.ToString();
+
+ this.header.Enable(filter);
+ this.header.AddFilterSetting(filter, new List<string>(){ "source " }, source);
+ this.header.AddFilterSetting(filter, new List<string>(){ "medium" }, medium);
+ this.header.AddFilterSetting(filter, new List<string>(){ "term" }, term);
+ this.header.AddFilterSetting(filter, new List<string>(){ "content" }, content);
+ this.header.AddFilterSetting(filter, new List<string>(){ "compaign" }, campaign);
}
public void EnableTemplate(string html = null)
{
- throw new NotImplementedException();
+ var filter = Filters.GoogleAnalytics.ToString();
+
+ this.header.Enable(filter);
+ this.header.AddFilterSetting(filter, new List<string>(){ "html" }, html);
}
public void EnableBcc(string email = null)
{
- throw new NotImplementedException();
+ var filter = Filters.Bcc.ToString();
+
+ this.header.Enable(filter);
+ this.header.AddFilterSetting(filter, new List<string>(){ "email" }, email);
}
- public void EnableBipassListManaement()
+ public void EnableBypassListManagement()
{
- throw new NotImplementedException();
+ this.header.Enable(Filters.BypassListManagement.ToString());
}
public void Mail()
diff --git a/SendGrid/Tests/Tests.csproj b/SendGrid/Tests/Tests.csproj index 0fcdc86..778e879 100755 --- a/SendGrid/Tests/Tests.csproj +++ b/SendGrid/Tests/Tests.csproj @@ -56,7 +56,9 @@ <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
- <None Include="packages.config" />
+ <None Include="packages.config">
+ <SubType>Designer</SubType>
+ </None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SendGrid\Mail.csproj">
|