diff options
author | Wataru Sato <awwa500@gmail.com> | 2015-01-28 18:31:14 +0900 |
---|---|---|
committer | Wataru Sato <awwa500@gmail.com> | 2015-01-28 18:31:14 +0900 |
commit | 35a76e291ee4cfbbe63a21a4b3819537eb0781fc (patch) | |
tree | 9a9bd83e9b5b2522350c98a2b1ed01059f6d7717 | |
parent | c14afcfbcf4aa04132a3742528b17f461272fa7c (diff) | |
download | sendgrid-csharp-35a76e291ee4cfbbe63a21a4b3819537eb0781fc.zip sendgrid-csharp-35a76e291ee4cfbbe63a21a4b3819537eb0781fc.tar.gz sendgrid-csharp-35a76e291ee4cfbbe63a21a4b3819537eb0781fc.tar.bz2 |
AddSection
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | SendGrid/Example/Program.cs | 8 | ||||
-rw-r--r-- | SendGrid/SendGridMail/SendGrid.cs | 9 | ||||
-rw-r--r-- | SendGrid/Tests/TestSendgrid.cs | 18 |
4 files changed, 20 insertions, 17 deletions
@@ -16,3 +16,5 @@ SendGrid/test-results/ .DS_store SendGrid/SendGrid.userprefs SendGrid/packages/ +SendGrid/TestResult.xml +SendGrid/SendGrid.sln.VisualState.xml diff --git a/SendGrid/Example/Program.cs b/SendGrid/Example/Program.cs index aa8a5a9..113e3f5 100644 --- a/SendGrid/Example/Program.cs +++ b/SendGrid/Example/Program.cs @@ -13,14 +13,14 @@ namespace Example {
// Create the email object first, then add the properties.
var myMessage = new SendGridMessage();
- myMessage.AddTo("anna@example.com");
+ myMessage.AddTo("anna@example.com");
myMessage.From = new MailAddress("john@example.com", "John Smith");
myMessage.Subject = "Testing the SendGrid Library";
myMessage.Text = "Hello World! %tag%";
- var subs = new List<String> { "私は%type%ラーメンが大好き" };
- myMessage.AddSubstitution("%tag%",subs);
- myMessage.AddSection("%type%", "とんこつ");
+ var subs = new List<String> { "私は%type%ラーメンが大好き" };
+ myMessage.AddSubstitution("%tag%",subs);
+ myMessage.AddSection("%type%", "とんこつ");
SendAsync(myMessage);
diff --git a/SendGrid/SendGridMail/SendGrid.cs b/SendGrid/SendGridMail/SendGrid.cs index ef8f8df..6a3dceb 100644 --- a/SendGrid/SendGridMail/SendGrid.cs +++ b/SendGrid/SendGridMail/SendGrid.cs @@ -221,10 +221,11 @@ namespace SendGrid //let the system complain if they do something bad, since the function returns null
Header.AddSubstitution(replacementTag, substitutionValues);
}
- public void AddSection(String relacementTag, String sectionValue)
- {
- Header.AddSection(relacementTag, sectionValue);
- }
+
+ public void AddSection(String relacementTag, String sectionValue)
+ {
+ Header.AddSection(relacementTag, sectionValue);
+ }
public void AddUniqueArgs(IDictionary<String, String> identifiers)
{
diff --git a/SendGrid/Tests/TestSendgrid.cs b/SendGrid/Tests/TestSendgrid.cs index 400c64f..dfd4c73 100644 --- a/SendGrid/Tests/TestSendgrid.cs +++ b/SendGrid/Tests/TestSendgrid.cs @@ -347,16 +347,16 @@ namespace Tests Assert.AreEqual("{\"filters\" : {\"opentrack\" : {\"settings\" : {\"enable\" : \"0\"}}}}", json);
}
- [Test]
- public void TestAddSection()
- {
- var header = new Header();
- var sendgrid = new SendGridMessage(header);
+ [Test]
+ public void TestAddSection()
+ {
+ var header = new Header();
+ var sendgrid = new SendGridMessage(header);
- sendgrid.AddSection("tag", "value");
+ sendgrid.AddSection("tag", "value");
- var json = header.JsonString();
- Assert.AreEqual("{\"section\" : {\"tag\" : \"value\"}}", json);
- }
+ var json = header.JsonString();
+ Assert.AreEqual("{\"section\" : {\"tag\" : \"value\"}}", json);
+ }
}
}
\ No newline at end of file |