summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxim Dubrovkin <dubrovkinmaxim@gmail.com>2016-09-20 20:59:45 +0500
committerMaxim Dubrovkin <dubrovkinmaxim@gmail.com>2016-09-20 20:59:45 +0500
commit33247ba8059cae2075efe0ef43060f163b986eeb (patch)
tree612c1a604d170f07bc3800c2d3fb9e538ab9ccbd
parentd4bee913ec3d94aad50afc60acdd24acff5d4570 (diff)
downloadsendgrid-csharp-33247ba8059cae2075efe0ef43060f163b986eeb.zip
sendgrid-csharp-33247ba8059cae2075efe0ef43060f163b986eeb.tar.gz
sendgrid-csharp-33247ba8059cae2075efe0ef43060f163b986eeb.tar.bz2
Fixes after huge merge
-rw-r--r--SendGrid/SendGrid/Helpers/Mail/BCCSettings.cs14
-rw-r--r--SendGrid/SendGrid/Helpers/Mail/BypassListManagement.cs2
-rw-r--r--SendGrid/SendGrid/Helpers/Mail/ClickTracking.cs16
-rw-r--r--SendGrid/SendGrid/Helpers/Mail/FooterSettings.cs2
-rw-r--r--SendGrid/SendGrid/Helpers/Mail/Ganalytics.cs38
-rw-r--r--SendGrid/SendGrid/Helpers/Mail/Mail.cs1255
-rw-r--r--SendGrid/SendGrid/Helpers/Mail/OpenTracking.cs14
-rw-r--r--SendGrid/SendGrid/Helpers/Mail/Personalization.cs2
-rw-r--r--SendGrid/SendGrid/Helpers/Mail/SandboxMode.cs8
-rw-r--r--SendGrid/SendGrid/Helpers/Mail/SpamCheck.cs6
-rw-r--r--SendGrid/SendGrid/Helpers/Mail/TrackingSettings.cs26
-rw-r--r--SendGrid/SendGrid/SendGrid.csproj16
12 files changed, 124 insertions, 1275 deletions
diff --git a/SendGrid/SendGrid/Helpers/Mail/BCCSettings.cs b/SendGrid/SendGrid/Helpers/Mail/BCCSettings.cs
index d638bb6..172bdec 100644
--- a/SendGrid/SendGrid/Helpers/Mail/BCCSettings.cs
+++ b/SendGrid/SendGrid/Helpers/Mail/BCCSettings.cs
@@ -2,12 +2,12 @@
namespace SendGrid.Helpers.Mail
{
- public class BCCSettings
- {
- [JsonProperty(PropertyName = "enable")]
- public bool Enable { get; set; }
-
- [JsonProperty(PropertyName = "email")]
- public string Email { get; set; }
+ public class BCCSettings
+ {
+ [JsonProperty(PropertyName = "enable")]
+ public bool? Enable { get; set; }
+
+ [JsonProperty(PropertyName = "email")]
+ public string Email { get; set; }
}
} \ No newline at end of file
diff --git a/SendGrid/SendGrid/Helpers/Mail/BypassListManagement.cs b/SendGrid/SendGrid/Helpers/Mail/BypassListManagement.cs
index 16b035c..03e072c 100644
--- a/SendGrid/SendGrid/Helpers/Mail/BypassListManagement.cs
+++ b/SendGrid/SendGrid/Helpers/Mail/BypassListManagement.cs
@@ -1,4 +1,4 @@
-using Newtonsoft.Json;
+using Newtonsoft.Json;
namespace SendGrid.Helpers.Mail
{
diff --git a/SendGrid/SendGrid/Helpers/Mail/ClickTracking.cs b/SendGrid/SendGrid/Helpers/Mail/ClickTracking.cs
index ce2c142..87f9e13 100644
--- a/SendGrid/SendGrid/Helpers/Mail/ClickTracking.cs
+++ b/SendGrid/SendGrid/Helpers/Mail/ClickTracking.cs
@@ -1,13 +1,13 @@
-using Newtonsoft.Json;
+using Newtonsoft.Json;
namespace SendGrid.Helpers.Mail
{
- public class ClickTracking
- {
- [JsonProperty(PropertyName = "enable")]
- public bool Enable { get; set; }
-
- [JsonProperty(PropertyName = "enable_text")]
- public bool EnableText { get; set; }
+ public class ClickTracking
+ {
+ [JsonProperty(PropertyName = "enable")]
+ public bool? Enable { get; set; }
+
+ [JsonProperty(PropertyName = "enable_text")]
+ public bool? EnableText { get; set; }
}
} \ No newline at end of file
diff --git a/SendGrid/SendGrid/Helpers/Mail/FooterSettings.cs b/SendGrid/SendGrid/Helpers/Mail/FooterSettings.cs
index f804a31..0b63580 100644
--- a/SendGrid/SendGrid/Helpers/Mail/FooterSettings.cs
+++ b/SendGrid/SendGrid/Helpers/Mail/FooterSettings.cs
@@ -1,4 +1,4 @@
-using Newtonsoft.Json;
+using Newtonsoft.Json;
namespace SendGrid.Helpers.Mail
{
diff --git a/SendGrid/SendGrid/Helpers/Mail/Ganalytics.cs b/SendGrid/SendGrid/Helpers/Mail/Ganalytics.cs
index 7284876..0609445 100644
--- a/SendGrid/SendGrid/Helpers/Mail/Ganalytics.cs
+++ b/SendGrid/SendGrid/Helpers/Mail/Ganalytics.cs
@@ -2,24 +2,24 @@
namespace SendGrid.Helpers.Mail
{
- public class Ganalytics
- {
- [JsonProperty(PropertyName = "enable")]
- public bool Enable { get; set; }
-
- [JsonProperty(PropertyName = "utm_source")]
- public string UtmSource { get; set; }
-
- [JsonProperty(PropertyName = "utm_medium")]
- public string UtmMedium { get; set; }
-
- [JsonProperty(PropertyName = "utm_term")]
- public string UtmTerm { get; set; }
-
- [JsonProperty(PropertyName = "utm_content")]
- public string UtmContent { get; set; }
-
- [JsonProperty(PropertyName = "utm_campaign")]
- public string UtmCampaign { get; set; }
+ public class Ganalytics
+ {
+ [JsonProperty(PropertyName = "enable")]
+ public bool? Enable { get; set; }
+
+ [JsonProperty(PropertyName = "utm_source")]
+ public string UtmSource { get; set; }
+
+ [JsonProperty(PropertyName = "utm_medium")]
+ public string UtmMedium { get; set; }
+
+ [JsonProperty(PropertyName = "utm_term")]
+ public string UtmTerm { get; set; }
+
+ [JsonProperty(PropertyName = "utm_content")]
+ public string UtmContent { get; set; }
+
+ [JsonProperty(PropertyName = "utm_campaign")]
+ public string UtmCampaign { get; set; }
}
} \ No newline at end of file
diff --git a/SendGrid/SendGrid/Helpers/Mail/Mail.cs b/SendGrid/SendGrid/Helpers/Mail/Mail.cs
index 21a13c4..8fd618d 100644
--- a/SendGrid/SendGrid/Helpers/Mail/Mail.cs
+++ b/SendGrid/SendGrid/Helpers/Mail/Mail.cs
@@ -1,7 +1,5 @@
using Newtonsoft.Json;
-using System;
using System.Collections.Generic;
-using System.Linq;
namespace SendGrid.Helpers.Mail
{
@@ -10,276 +8,72 @@ namespace SendGrid.Helpers.Mail
/// </summary>
public class Mail
{
- private Email from;
- private String subject;
- private List<Personalization> personalizations;
- private List<Content> contents;
- private List<Attachment> attachments;
- private String templateId;
- private Dictionary<String, String> headers;
- private Dictionary<String, String> sections;
- private List<String> categories;
- private Dictionary<String, String> customArgs;
- private long? sendAt;
- private ASM asm;
- private String batchId;
- private String setIpPoolId;
- private MailSettings mailSettings;
- private TrackingSettings trackingSettings;
- private Email replyTo;
-
public Mail()
{
- return;
}
- public Mail(Email from, String subject, Email to, Content content)
+ public Mail(Email from, string subject, Email to, Content content)
{
this.From = from;
- Personalization personalization = new Personalization();
+
+ var personalization = new Personalization();
personalization.AddTo(to);
this.AddPersonalization(personalization);
+
this.Subject = subject;
this.AddContent(content);
}
[JsonProperty(PropertyName = "from")]
- public Email From
- {
- get
- {
- return from;
- }
-
- set
- {
- from = value;
- }
- }
+ public Email From { get; set; }
[JsonProperty(PropertyName = "subject")]
- public string Subject
- {
- get
- {
- return subject;
- }
-
- set
- {
- subject = value;
- }
- }
+ public string Subject { get; set; }
[JsonProperty(PropertyName = "personalizations")]
- public List<Personalization> Personalization
- {
- get
- {
- return personalizations;
- }
-
- set
- {
- personalizations = value;
- }
- }
+ public List<Personalization> Personalization { get; set; }
[JsonProperty(PropertyName = "content")]
- public List<Content> Contents
- {
- get
- {
- return contents;
- }
-
- set
- {
- contents = value;
- }
- }
+ public List<Content> Contents { get; set; }
[JsonProperty(PropertyName = "attachments")]
- public List<Attachment> Attachments
- {
- get
- {
- return attachments;
- }
-
- set
- {
- attachments = value;
- }
- }
+ public List<Attachment> Attachments { get; set; }
[JsonProperty(PropertyName = "template_id")]
- public string TemplateId
- {
- get
- {
- return templateId;
- }
-
- set
- {
- templateId = value;
- }
- }
+ public string TemplateId { get; set; }
[JsonProperty(PropertyName = "headers")]
- public Dictionary<string, string> Headers
- {
- get
- {
- return headers;
- }
-
- set
- {
- headers = value;
- }
- }
+ public Dictionary<string, string> Headers { get; set; }
[JsonProperty(PropertyName = "sections")]
- public Dictionary<string, string> Sections
- {
- get
- {
- return sections;
- }
-
- set
- {
- sections = value;
- }
- }
+ public Dictionary<string, string> Sections { get; set; }
[JsonProperty(PropertyName = "categories")]
- public List<string> Categories
- {
- get
- {
- return categories;
- }
-
- set
- {
- categories = value;
- }
- }
+ public List<string> Categories { get; set; }
[JsonProperty(PropertyName = "custom_args")]
- public Dictionary<string, string> CustomArgs
- {
- get
- {
- return customArgs;
- }
-
- set
- {
- customArgs = value;
- }
- }
+ public Dictionary<string, string> CustomArgs { get; set; }
[JsonProperty(PropertyName = "send_at")]
- public long? SendAt
- {
- get
- {
- return sendAt;
- }
-
- set
- {
- sendAt = value;
- }
- }
+ public long? SendAt { get; set; }
[JsonProperty(PropertyName = "asm")]
- public ASM Asm
- {
- get
- {
- return asm;
- }
-
- set
- {
- asm = value;
- }
- }
+ public ASM Asm { get; set; }
[JsonProperty(PropertyName = "batch_id")]
- public string BatchId
- {
- get
- {
- return batchId;
- }
-
- set
- {
- batchId = value;
- }
- }
+ public string BatchId { get; set; }
[JsonProperty(PropertyName = "ip_pool_name")]
- public string SetIpPoolId
- {
- get
- {
- return setIpPoolId;
- }
-
- set
- {
- setIpPoolId = value;
- }
- }
+ public string SetIpPoolId { get; set; }
[JsonProperty(PropertyName = "mail_settings")]
- public MailSettings MailSettings
- {
- get
- {
- return mailSettings;
- }
-
- set
- {
- mailSettings = value;
- }
- }
+ public MailSettings MailSettings { get; set; }
[JsonProperty(PropertyName = "tracking_settings")]
- public TrackingSettings TrackingSettings
- {
- get
- {
- return trackingSettings;
- }
-
- set
- {
- trackingSettings = value;
- }
- }
+ public TrackingSettings TrackingSettings { get; set; }
[JsonProperty(PropertyName = "reply_to")]
- public Email ReplyTo
- {
- get
- {
- return replyTo;
- }
-
- set
- {
- replyTo = value;
- }
- }
+ public Email ReplyTo { get; set; }
public void AddPersonalization(Personalization personalization)
{
@@ -308,1013 +102,52 @@ namespace SendGrid.Helpers.Mail
Attachments.Add(attachment);
}
- public void AddHeader(String key, String value)
+ public void AddHeader(string key, string value)
{
- if (headers == null)
+ if (Headers == null)
{
- headers = new Dictionary<String, String>();
+ Headers = new Dictionary<string, string>();
}
- headers.Add(key, value);
+ Headers.Add(key, value);
}
- public void AddSection(String key, String value)
+ public void AddSection(string key, string value)
{
- if (sections == null)
+ if (Sections == null)
{
- sections = new Dictionary<String, String>();
+ Sections = new Dictionary<string, string>();
}
- sections.Add(key, value);
+ Sections.Add(key, value);
}
- public void AddCategory(String category)
+ public void AddCategory(string category)
{
if (Categories == null)
{
- Categories = new List<String>();
+ Categories = new List<string>();
}
Categories.Add(category);
}
- public void AddCustomArgs(String key, String value)
+ public void AddCustomArgs(string key, string value)
{
- if (customArgs == null)
+ if (CustomArgs == null)
{
- customArgs = new Dictionary<String, String>();
+ CustomArgs = new Dictionary<string, string>();
}
- customArgs.Add(key, value);
+ CustomArgs.Add(key, value);
}
- public String Get()
+ public string Get()
{
return JsonConvert.SerializeObject(this,
- Formatting.None,
- new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Include, StringEscapeHandling = StringEscapeHandling.EscapeHtml });
- }
- }
-
-
- public class ClickTracking
- {
- private bool? enable;
- private bool? enableText;
-
- [JsonProperty(PropertyName = "enable")]
- public bool? Enable
- {
- get
- {
- return enable;
- }
-
- set
- {
- enable = value;
- }
- }
-
- [JsonProperty(PropertyName = "enable_text")]
- public bool? EnableText
- {
- get
- {
- return enableText;
- }
-
- set
- {
- enableText = value;
- }
- }
- }
-
-
- public class OpenTracking
- {
- private bool? enable;
- private String substitutionTag;
-
- [JsonProperty(PropertyName = "enable")]
- public bool? Enable
- {
- get
- {
- return enable;
- }
-
- set
- {
- enable = value;
- }
- }
-
- [JsonProperty(PropertyName = "substitution_tag")]
- public string SubstitutionTag
- {
- get
- {
- return substitutionTag;
- }
-
- set
- {
- substitutionTag = value;
- }
- }
- }
-
-
- public class SubscriptionTracking
- {
- private bool? enable;
- private String text;
- private String html;
- private String substitutionTag;
-
- [JsonProperty(PropertyName = "enable")]
- public bool? Enable
- {
- get
- {
- return enable;
- }
-
- set
- {
- enable = value;
- }
- }
-
- [JsonProperty(PropertyName = "text")]
- public string Text
- {
- get
- {
- return text;
- }
-
- set
- {
- text = value;
- }
- }
-
- [JsonProperty(PropertyName = "html")]
- public string Html
- {
- get
- {
- return html;
- }
-
- set
- {
- html = value;
- }
- }
-
- [JsonProperty(PropertyName = "substitution_tag")]
- public string SubstitutionTag
- {
- get
- {
- return substitutionTag;
- }
-
- set
- {
- substitutionTag = value;
- }
- }
- }
-
-
- public class Ganalytics
- {
- private bool? enable;
- private String utmSource;
- private String utmMedium;
- private String utmTerm;
- private String utmContent;
- private String utmCampaign;
-
- [JsonProperty(PropertyName = "enable")]
- public bool? Enable
- {
- get
- {
- return enable;
- }
-
- set
- {
- enable = value;
- }
- }
-
- [JsonProperty(PropertyName = "utm_source")]
- public string UtmSource
- {
- get
- {
- return utmSource;
- }
-
- set
- {
- utmSource = value;
- }
- }
-
- [JsonProperty(PropertyName = "utm_medium")]
- public string UtmMedium
- {
- get
- {
- return utmMedium;
- }
-
- set
- {
- utmMedium = value;
- }
- }
-
- [JsonProperty(PropertyName = "utm_term")]
- public string UtmTerm
- {
- get
- {
- return utmTerm;
- }
-
- set
- {
- utmTerm = value;
- }
- }
-
- [JsonProperty(PropertyName = "utm_content")]
- public string UtmContent
- {
- get
- {
- return utmContent;
- }
-
- set
- {
- utmContent = value;
- }
- }
-
- [JsonProperty(PropertyName = "utm_campaign")]
- public string UtmCampaign
- {
- get
- {
- return utmCampaign;
- }
-
- set
- {
- utmCampaign = value;
- }
+ Formatting.None,
+ new JsonSerializerSettings
+ {
+ NullValueHandling = NullValueHandling.Ignore,
+ DefaultValueHandling = DefaultValueHandling.Include,
+ StringEscapeHandling = StringEscapeHandling.EscapeHtml
+ });
}
}
-
-
- public class TrackingSettings
- {
- private ClickTracking clickTracking;
- private OpenTracking openTracking;
- private SubscriptionTracking subscriptionTracking;
- private Ganalytics ganalytics;
-
- [JsonProperty(PropertyName = "click_tracking")]
- public ClickTracking ClickTracking
- {
- get
- {
- return clickTracking;
- }
-
- set
- {
- clickTracking = value;
- }
- }
-
- [JsonProperty(PropertyName = "open_tracking")]
- public OpenTracking OpenTracking
- {
- get
- {
- return openTracking;
- }
-
- set
- {
- openTracking = value;
- }
- }
-
- [JsonProperty(PropertyName = "subscription_tracking")]
- public SubscriptionTracking SubscriptionTracking
- {
- get
- {
- return subscriptionTracking;
- }
-
- set
- {
- subscriptionTracking = value;
- }
- }
-
- [JsonProperty(PropertyName = "ganalytics")]
- public Ganalytics Ganalytics
- {
- get
- {
- return ganalytics;
- }
-
- set
- {
- ganalytics = value;
- }
- }
- }
-
-
- public class BCCSettings
- {
- private bool? enable;
- private String email;
-
- [JsonProperty(PropertyName = "enable")]
- public bool? Enable
- {
- get
- {
- return enable;
- }
-
- set
- {
- enable = value;
- }
- }
-
- [JsonProperty(PropertyName = "email")]
- public string Email
- {
- get
- {
- return email;
- }
-
- set
- {
- email = value;
- }
- }
- }
-
-
- public class BypassListManagement
- {
- private bool? enable;
-
- [JsonProperty(PropertyName = "enable")]
- public bool? Enable
- {
- get
- {
- return enable;
- }
-
- set
- {
- enable = value;
- }
- }
- }
-
-
- public class FooterSettings
- {
- private bool? enable;
- private String text;
- private String html;
-
- [JsonProperty(PropertyName = "enable")]
- public bool? Enable
- {
- get
- {
- return enable;
- }
-
- set
- {
- enable = value;
- }
- }
-
- [JsonProperty(PropertyName = "text")]
- public string Text
- {
- get
- {
- return text;
- }
-
- set
- {
- text = value;
- }
- }
-
- [JsonProperty(PropertyName = "html")]
- public string Html
- {
- get
- {
- return html;
- }
-
- set
- {
- html = value;
- }
- }
- }
-
-
- public class SandboxMode
- {
- private bool? enable;
-
- [JsonProperty(PropertyName = "enable")]
- public bool? Enable
- {
- get
- {
- return enable;
- }
-
- set
- {
- enable = value;
- }
- }
- }
-
-
- public class SpamCheck
- {
- private bool? enable;
- private int? threshold;
- private String postToUrl;
-
- [JsonProperty(PropertyName = "enable")]
- public bool? Enable
- {
- get
- {
- return enable;
- }
-
- set
- {
- enable = value;
- }
- }
-
- [JsonProperty(PropertyName = "threshold")]
- public int? Threshold
- {
- get
- {
- return threshold;
- }
-
- set
- {
- threshold = value;
- }
- }
-
- [JsonProperty(PropertyName = "post_to_url")]
- public string PostToUrl
- {
- get
- {
- return postToUrl;
- }
-
- set
- {
- postToUrl = value;
- }
- }
- }
-
-
- public class MailSettings
- {
- private BCCSettings bccSettings;
- private BypassListManagement bypassListManagement;
- private FooterSettings footerSettings;
- private SandboxMode sandboxMode;
- private SpamCheck spamCheck;
-
- [JsonProperty(PropertyName = "bcc")]
- public BCCSettings BccSettings
- {
- get
- {
- return bccSettings;
- }
-
- set
- {
- bccSettings = value;
- }
- }
-
- [JsonProperty(PropertyName = "bypass_list_management")]
- public BypassListManagement BypassListManagement
- {
- get
- {
- return bypassListManagement;
- }
-
- set
- {
- bypassListManagement = value;
- }
- }
-
- [JsonProperty(PropertyName = "footer")]
- public FooterSettings FooterSettings
- {
- get
- {
- return footerSettings;
- }
-
- set
- {
- footerSettings = value;
- }
- }
-
- [JsonProperty(PropertyName = "sandbox_mode")]
- public SandboxMode SandboxMode
- {
- get
- {
- return sandboxMode;
- }
-
- set
- {
- sandboxMode = value;
- }
- }
-
- [JsonProperty(PropertyName = "spam_check")]
- public SpamCheck SpamCheck
- {
- get
- {
- return spamCheck;
- }
-
- set
- {
- spamCheck = value;
- }
- }
- }
-
-
- public class ASM
- {
- private int? groupId;
- private List<int> groupsToDisplay;
-
- [JsonProperty(PropertyName = "group_id")]
- public int? GroupId
- {
- get
- {
- return groupId;
- }
-
- set
- {
- groupId = value;
- }
- }
-
- [JsonProperty(PropertyName = "groups_to_display")]
- public List<int> GroupsToDisplay
- {
- get
- {
- return groupsToDisplay;
- }
-
- set
- {
- groupsToDisplay = value;
- }
- }
- }
-
-
- public class Attachment
- {
- private String content;
- private String type;
- private String filename;
- private String disposition;
- private String contentId;
-
- [JsonProperty(PropertyName = "content")]
- public string Content
- {
- get
- {
- return content;
- }
-
- set
- {
- content = value;
- }
- }
-
- [JsonProperty(PropertyName = "type")]
- public string Type
- {
- get
- {
- return type;
- }
-
- set
- {
- type = value;
- }
- }
-
- [JsonProperty(PropertyName = "filename")]
- public string Filename
- {
- get
- {
- return filename;
- }
-
- set
- {
- filename = value;
- }
- }
-
- [JsonProperty(PropertyName = "disposition")]
- public string Disposition
- {
- get
- {
- return disposition;
- }
-
- set
- {
- disposition = value;
- }
- }
-
- [JsonProperty(PropertyName = "content_id")]
- public string ContentId
- {
- get
- {
- return contentId;
- }
-
- set
- {
- contentId = value;
- }
- }
- }
-
-
- public class Content
- {
- private String type;
- private String value;
-
- public Content()
- {
- return;
- }
-
- public Content(String type, String value)
- {
- this.Type = type;
- this.Value = value;
- }
-
- [JsonProperty(PropertyName = "type")]
- public string Type
- {
- get
- {
- return type;
- }
-
- set
- {
- type = value;
- }
- }
-
- [JsonProperty(PropertyName = "value")]
- public string Value
- {
- get
- {
- return value;
- }
-
- set
- {
- this.value = value;
- }
- }
- }
-
-
- public class Email
- {
- private String name;
- private String address;
-
- public Email()
- {
- return;
- }
-
- public Email(String email, String name = null)
- {
- this.Address = email;
- this.Name = name;
- }
-
- [JsonProperty(PropertyName = "name")]
- public string Name
- {
- get
- {
- return name;
- }
-
- set
- {
- name = value;
- }
- }
-
- [JsonProperty(PropertyName = "email")]
- public string Address
- {
- get
- {
- return address;
- }
-
- set
- {
- address = value;
- }
- }
- }
-
-
- public class Personalization
- {
- private List<Email> tos;
- private List<Email> ccs;
- private List<Email> bccs;
- private String subject;
- private Dictionary<String, String> headers;
- private Dictionary<String, String> substitutions;
- private Dictionary<String, String> customArgs;
- private long? sendAt;
-
- public bool ShouldSerializeTos()
- {
- if (this.tos != null)
- {
- return this.tos.Any();
- }
- return false;
- }
-
- [JsonProperty(PropertyName = "to")]
- public List<Email> Tos
- {
- get
- {
- return tos;
- }
-
- set
- {
- tos = value;
- }
- }
-
-
- public bool ShouldSerializeCcs()
- {
- if (this.ccs != null)
- {
- return this.ccs.Any();
- }
- return false;
- }
-
- [JsonProperty(PropertyName = "cc")]
- public List<Email> Ccs
- {
- get
- {
- return ccs;
- }
-
- set
- {
- ccs = value;
- }
- }
-
- public bool ShouldSerializeBccs()
- {
- if (this.bccs != null)
- {
- return this.bccs.Any();
- }
- return false;
- }
-
- [JsonProperty(PropertyName = "bcc")]
- public List<Email> Bccs
- {
- get
- {
- return bccs;
- }
-
- set
- {
- bccs = value;
- }
- }
-
- [JsonProperty(PropertyName = "subject")]
- public string Subject
- {
- get
- {
- return subject;
- }
-
- set
- {
- subject = value;
- }
- }
-
- [JsonProperty(PropertyName = "headers")]
- public Dictionary<string, string> Headers
- {
- get
- {
- return headers;
- }
-
- set
- {
- headers = value;
- }
- }
-
- [JsonProperty(PropertyName = "substitutions")]
- public Dictionary<string, string> Substitutions
- {
- get
- {
- return substitutions;
- }
-
- set
- {
- substitutions = value;
- }
- }
-
- [JsonProperty(PropertyName = "custom_args")]
- public Dictionary<string, string> CustomArgs
- {
- get
- {
- return customArgs;
- }
-
- set
- {
- customArgs = value;
- }
- }
-
- [JsonProperty(PropertyName = "send_at")]
- public long? SendAt
- {
- get
- {
- return sendAt;
- }
-
- set
- {
- sendAt = value;
- }
- }
-
- public void AddTo(Email email)
- {
- if (tos == null)
- {
- tos = new List<Email>();
-
- }
- tos.Add(email);
- }
-
- public void AddCc(Email email)
- {
- if (ccs == null)
- {
- ccs = new List<Email>();
- }
- ccs.Add(email);
- }
-
- public void AddBcc(Email email)
- {
- if (bccs == null)
- {
- bccs = new List<Email>();
- }
- bccs.Add(email);
- }
-
- public void AddHeader(String key, String value)
- {
- if (headers == null)
- {
- headers = new Dictionary<String, String>();
- }
- headers.Add(key, value);
- }
-
- public void AddSubstitution(String key, String value)
- {
- if (substitutions == null)
- {
- substitutions = new Dictionary<String, String>();
- }
- substitutions.Add(key, value);
- }
-
- public void AddCustomArgs(String key, String value)
- {
- if (customArgs == null)
- {
- customArgs = new Dictionary<String, String>();
- }
- customArgs.Add(key, value);
- }
- }
-}
-
+} \ No newline at end of file
diff --git a/SendGrid/SendGrid/Helpers/Mail/OpenTracking.cs b/SendGrid/SendGrid/Helpers/Mail/OpenTracking.cs
index 27b6429..93be8e3 100644
--- a/SendGrid/SendGrid/Helpers/Mail/OpenTracking.cs
+++ b/SendGrid/SendGrid/Helpers/Mail/OpenTracking.cs
@@ -2,12 +2,12 @@
namespace SendGrid.Helpers.Mail
{
- public class OpenTracking
- {
- [JsonProperty(PropertyName = "enable")]
- public bool Enable { get; set; }
-
- [JsonProperty(PropertyName = "substitution_tag")]
- public string SubstitutionTag { get; set; }
+ public class OpenTracking
+ {
+ [JsonProperty(PropertyName = "enable")]
+ public bool? Enable { get; set; }
+
+ [JsonProperty(PropertyName = "substitution_tag")]
+ public string SubstitutionTag { get; set; }
}
} \ No newline at end of file
diff --git a/SendGrid/SendGrid/Helpers/Mail/Personalization.cs b/SendGrid/SendGrid/Helpers/Mail/Personalization.cs
index 4deeede..fbab22d 100644
--- a/SendGrid/SendGrid/Helpers/Mail/Personalization.cs
+++ b/SendGrid/SendGrid/Helpers/Mail/Personalization.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using Newtonsoft.Json;
namespace SendGrid.Helpers.Mail
diff --git a/SendGrid/SendGrid/Helpers/Mail/SandboxMode.cs b/SendGrid/SendGrid/Helpers/Mail/SandboxMode.cs
index 7e2bdd7..f3bf237 100644
--- a/SendGrid/SendGrid/Helpers/Mail/SandboxMode.cs
+++ b/SendGrid/SendGrid/Helpers/Mail/SandboxMode.cs
@@ -2,9 +2,9 @@
namespace SendGrid.Helpers.Mail
{
- public class SandboxMode
- {
- [JsonProperty(PropertyName = "enable")]
- public bool Enable { get; set; }
+ public class SandboxMode
+ {
+ [JsonProperty(PropertyName = "enable")]
+ public bool? Enable { get; set; }
}
} \ No newline at end of file
diff --git a/SendGrid/SendGrid/Helpers/Mail/SpamCheck.cs b/SendGrid/SendGrid/Helpers/Mail/SpamCheck.cs
index d156df1..abf39ca 100644
--- a/SendGrid/SendGrid/Helpers/Mail/SpamCheck.cs
+++ b/SendGrid/SendGrid/Helpers/Mail/SpamCheck.cs
@@ -1,14 +1,14 @@
-using Newtonsoft.Json;
+using Newtonsoft.Json;
namespace SendGrid.Helpers.Mail
{
public class SpamCheck
{
[JsonProperty(PropertyName = "enable")]
- public bool Enable { get; set; }
+ public bool? Enable { get; set; }
[JsonProperty(PropertyName = "threshold")]
- public int Threshold { get; set; }
+ public int? Threshold { get; set; }
[JsonProperty(PropertyName = "post_to_url")]
public string PostToUrl { get; set; }
diff --git a/SendGrid/SendGrid/Helpers/Mail/TrackingSettings.cs b/SendGrid/SendGrid/Helpers/Mail/TrackingSettings.cs
index 8bb0a32..3a453f8 100644
--- a/SendGrid/SendGrid/Helpers/Mail/TrackingSettings.cs
+++ b/SendGrid/SendGrid/Helpers/Mail/TrackingSettings.cs
@@ -2,18 +2,18 @@
namespace SendGrid.Helpers.Mail
{
- public class TrackingSettings
- {
- [JsonProperty(PropertyName = "click_tracking")]
- public ClickTracking ClickTracking { get; set; }
-
- [JsonProperty(PropertyName = "open_tracking")]
- public OpenTracking OpenTracking { get; set; }
-
- [JsonProperty(PropertyName = "subscription_tracking")]
- public SubscriptionTracking SubscriptionTracking { get; set; }
-
- [JsonProperty(PropertyName = "ganalytics")]
- public Ganalytics Ganalytics { get; set; }
+ public class TrackingSettings
+ {
+ [JsonProperty(PropertyName = "click_tracking")]
+ public ClickTracking ClickTracking { get; set; }
+
+ [JsonProperty(PropertyName = "open_tracking")]
+ public OpenTracking OpenTracking { get; set; }
+
+ [JsonProperty(PropertyName = "subscription_tracking")]
+ public SubscriptionTracking SubscriptionTracking { get; set; }
+
+ [JsonProperty(PropertyName = "ganalytics")]
+ public Ganalytics Ganalytics { get; set; }
}
} \ No newline at end of file
diff --git a/SendGrid/SendGrid/SendGrid.csproj b/SendGrid/SendGrid/SendGrid.csproj
index 22f8d11..cba6595 100644
--- a/SendGrid/SendGrid/SendGrid.csproj
+++ b/SendGrid/SendGrid/SendGrid.csproj
@@ -68,7 +68,23 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Client.cs" />
+ <Compile Include="Helpers\Mail\ASM.cs" />
+ <Compile Include="Helpers\Mail\Attachment.cs" />
+ <Compile Include="Helpers\Mail\BCCSettings.cs" />
+ <Compile Include="Helpers\Mail\BypassListManagement.cs" />
+ <Compile Include="Helpers\Mail\ClickTracking.cs" />
+ <Compile Include="Helpers\Mail\Content.cs" />
+ <Compile Include="Helpers\Mail\Email.cs" />
+ <Compile Include="Helpers\Mail\FooterSettings.cs" />
+ <Compile Include="Helpers\Mail\Ganalytics.cs" />
<Compile Include="Helpers\Mail\Mail.cs" />
+ <Compile Include="Helpers\Mail\MailSettings.cs" />
+ <Compile Include="Helpers\Mail\OpenTracking.cs" />
+ <Compile Include="Helpers\Mail\Personalization.cs" />
+ <Compile Include="Helpers\Mail\SandboxMode.cs" />
+ <Compile Include="Helpers\Mail\SpamCheck.cs" />
+ <Compile Include="Helpers\Mail\SubscriptionTracking.cs" />
+ <Compile Include="Helpers\Mail\TrackingSettings.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>