summaryrefslogtreecommitdiffstats
path: root/src/SendGrid/Helpers/Mail/Model/Content.cs
diff options
context:
space:
mode:
authorElmer Thomas <elmer@thinkingserious.com>2016-12-12 23:58:19 -0800
committerElmer Thomas <elmer@thinkingserious.com>2016-12-12 23:58:19 -0800
commit83a0891c8917d06031571015e24c1acf88ac4ae2 (patch)
tree7b7f015a1c4f8a587624ada56a0af7746ef0a882 /src/SendGrid/Helpers/Mail/Model/Content.cs
parentff603f56e723d3e49c453cfdfe8dcf05617b6b50 (diff)
downloadsendgrid-csharp-origin/single-email.zip
sendgrid-csharp-origin/single-email.tar.gz
sendgrid-csharp-origin/single-email.tar.bz2
Properties FTW, Cancellation Tokens, Reorganizeorigin/single-email
Based on feedback from @darrelmiller and @jkewley on issue #331 and @taspeotis on issue 317. See ExampleCore for working example.
Diffstat (limited to 'src/SendGrid/Helpers/Mail/Model/Content.cs')
-rw-r--r--src/SendGrid/Helpers/Mail/Model/Content.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/SendGrid/Helpers/Mail/Model/Content.cs b/src/SendGrid/Helpers/Mail/Model/Content.cs
new file mode 100644
index 0000000..0f05156
--- /dev/null
+++ b/src/SendGrid/Helpers/Mail/Model/Content.cs
@@ -0,0 +1,41 @@
+using Newtonsoft.Json;
+
+namespace SendGrid.Helpers.Mail
+{
+ public class Content
+ {
+ public Content()
+ {
+ }
+
+ public Content(string type, string value)
+ {
+ this.Type = type;
+ this.Value = value;
+ }
+
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; set; }
+
+ [JsonProperty(PropertyName = "value")]
+ public string Value { get; set; }
+ }
+
+ public class PlainTextContent : Content
+ {
+ public PlainTextContent(string value)
+ {
+ this.Type = MimeType.Text;
+ this.Value = value;
+ }
+ }
+
+ public class HtmlContent : Content
+ {
+ public HtmlContent(string value)
+ {
+ this.Type = MimeType.Html;
+ this.Value = value;
+ }
+ }
+} \ No newline at end of file