diff options
author | Brandon West <brawest@gmail.com> | 2014-05-23 17:31:47 -0600 |
---|---|---|
committer | Brandon West <brawest@gmail.com> | 2014-05-23 17:31:57 -0600 |
commit | d86ef025cabce6867bf3b84ba782b68c899f66b3 (patch) | |
tree | 4d37bcc8dca11731c4e348a47dc9b8f0c35ae10b | |
parent | 8430d0eb48212c46e4ff0c7d300cdfcd7343172e (diff) | |
download | sendgrid-csharp-d86ef025cabce6867bf3b84ba782b68c899f66b3.zip sendgrid-csharp-d86ef025cabce6867bf3b84ba782b68c899f66b3.tar.gz sendgrid-csharp-d86ef025cabce6867bf3b84ba782b68c899f66b3.tar.bz2 |
fix constructor
-rw-r--r-- | SendGrid/Example/Example.csproj | 6 | ||||
-rw-r--r-- | SendGrid/SendGridMail/ISendGrid.cs | 2 | ||||
-rw-r--r-- | SendGrid/SendGridMail/Properties/AssemblyInfo.cs | 4 | ||||
-rw-r--r-- | SendGrid/SendGridMail/SendGrid.cs | 32 | ||||
-rw-r--r-- | SendGrid/SendGridMail/Transport/Web.cs | 12 |
5 files changed, 11 insertions, 45 deletions
diff --git a/SendGrid/Example/Example.csproj b/SendGrid/Example/Example.csproj index 235df7a..f1fb787 100644 --- a/SendGrid/Example/Example.csproj +++ b/SendGrid/Example/Example.csproj @@ -39,6 +39,9 @@ <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="SendGrid.SmtpApi">
+ <HintPath>..\SendGridMail\bin\Debug\SendGrid.SmtpApi.dll</HintPath>
+ </Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO">
@@ -87,6 +90,9 @@ <Name>Mail</Name>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <WCFMetadata Include="Service References\" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.13\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.13\tools\Microsoft.Bcl.Build.targets')" />
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
diff --git a/SendGrid/SendGridMail/ISendGrid.cs b/SendGrid/SendGridMail/ISendGrid.cs index b5f212c..7855ba1 100644 --- a/SendGrid/SendGridMail/ISendGrid.cs +++ b/SendGrid/SendGridMail/ISendGrid.cs @@ -16,8 +16,6 @@ namespace SendGrid MailAddress From { get; set; }
MailAddress[] To { get; set; }
- MailAddress[] Cc { get; }
- MailAddress[] Bcc { get; }
MailAddress[] ReplyTo { get; set; }
Dictionary<String, MemoryStream> StreamedAttachments { get; set; }
String[] Attachments { get; set; }
diff --git a/SendGrid/SendGridMail/Properties/AssemblyInfo.cs b/SendGrid/SendGridMail/Properties/AssemblyInfo.cs index 808cc1b..85aaaa2 100644 --- a/SendGrid/SendGridMail/Properties/AssemblyInfo.cs +++ b/SendGrid/SendGridMail/Properties/AssemblyInfo.cs @@ -42,5 +42,5 @@ using System.Runtime.InteropServices; // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("3.0.0")]
-[assembly: AssemblyFileVersion("3.0.0")]
\ No newline at end of file +[assembly: AssemblyVersion("3.0.1")]
+[assembly: AssemblyFileVersion("3.0.1")]
\ No newline at end of file diff --git a/SendGrid/SendGridMail/SendGrid.cs b/SendGrid/SendGridMail/SendGrid.cs index 6ce6c81..fe6a99b 100644 --- a/SendGrid/SendGridMail/SendGrid.cs +++ b/SendGrid/SendGridMail/SendGrid.cs @@ -40,13 +40,11 @@ namespace SendGrid Headers = new Dictionary<string, string>();
}
- public SendGridMessage(MailAddress from, MailAddress[] to, MailAddress[] cc, MailAddress[] bcc,
- String subject, String html, String text, IHeader header = null) : this(header)
+ public SendGridMessage(MailAddress from, MailAddress[] to,
+ String subject, String html, String text, IHeader header = null) : this()
{
From = from;
To = to;
- Cc = cc;
- Bcc = bcc;
_message.Subject = subject;
@@ -108,32 +106,6 @@ namespace SendGrid }
}
- public MailAddress[] Cc
- {
- get { return _message.CC.ToArray(); }
- set
- {
- _message.CC.Clear();
- foreach (var mailAddress in value)
- {
- _message.CC.Add(mailAddress);
- }
- }
- }
-
- public MailAddress[] Bcc
- {
- get { return _message.Bcc.ToArray(); }
- set
- {
- _message.Bcc.Clear();
- foreach (var mailAddress in value)
- {
- _message.Bcc.Add(mailAddress);
- }
- }
- }
-
public String Subject
{
get { return _message.Subject; }
diff --git a/SendGrid/SendGridMail/Transport/Web.cs b/SendGrid/SendGridMail/Transport/Web.cs index 179e156..f241256 100644 --- a/SendGrid/SendGridMail/Transport/Web.cs +++ b/SendGrid/SendGridMail/Transport/Web.cs @@ -181,7 +181,7 @@ namespace SendGrid new KeyValuePair<String, String>("subject", message.Subject),
new KeyValuePair<String, String>("text", message.Text),
new KeyValuePair<String, String>("html", message.Html),
- new KeyValuePair<String, String>("x-smtpapi", message.Header.JsonString())
+ new KeyValuePair<String, String>("x-smtpapi", message.Header.JsonString() ?? "")
};
if (message.To != null)
{
@@ -189,16 +189,6 @@ namespace SendGrid .Concat(message.To.ToList().Select(a => new KeyValuePair<String, String>("toname[]", a.DisplayName)))
.ToList();
}
- if (message.Bcc != null)
- {
- result = result.Concat(message.Bcc.ToList().Select(a => new KeyValuePair<String, String>("bcc[]", a.Address)))
- .ToList();
- }
- if (message.Cc != null)
- {
- result = result.Concat(message.Cc.ToList().Select(a => new KeyValuePair<String, String>("cc[]", a.Address)))
- .ToList();
- }
if (message.GetEmbeddedImages().Count > 0) {
result = result.Concat(message.GetEmbeddedImages().ToList().Select(x => new KeyValuePair<String, String>(string.Format("content[{0}]", x.Key), x.Value)))
.ToList();
|