diff options
author | Brandon West <brawest@gmail.com> | 2014-05-21 16:29:53 -0600 |
---|---|---|
committer | Brandon West <brawest@gmail.com> | 2014-05-21 16:29:53 -0600 |
commit | c48471c02bc8e9d47e4735fda5e3244636b118ef (patch) | |
tree | eff78a2f0a5c7243880855a8dd210279341f425c /SendGrid/SendGridMail/SendGrid.cs | |
parent | 20c3fb41794d39286965f515ab93c4d445380050 (diff) | |
parent | 47a7cc0bc1b4f5564b9768e32c71f9263da5e74b (diff) | |
download | sendgrid-csharp-c48471c02bc8e9d47e4735fda5e3244636b118ef.zip sendgrid-csharp-c48471c02bc8e9d47e4735fda5e3244636b118ef.tar.gz sendgrid-csharp-c48471c02bc8e9d47e4735fda5e3244636b118ef.tar.bz2 |
Merge pull request #57 from paroos/master
Improve handling with an IoC container
Diffstat (limited to 'SendGrid/SendGridMail/SendGrid.cs')
-rw-r--r-- | SendGrid/SendGridMail/SendGrid.cs | 55 |
1 files changed, 18 insertions, 37 deletions
diff --git a/SendGrid/SendGridMail/SendGrid.cs b/SendGrid/SendGridMail/SendGrid.cs index 54aaa96..3d2c6e2 100644 --- a/SendGrid/SendGridMail/SendGrid.cs +++ b/SendGrid/SendGridMail/SendGrid.cs @@ -23,8 +23,24 @@ namespace SendGridMail #endregion
#region Initialization and Constructors
-
- internal SendGrid(MailAddress from, MailAddress[] to, MailAddress[] cc, MailAddress[] bcc,
+
+ /// <summary>
+ /// Creates an instance of SendGrid's custom message object
+ /// </summary>
+ /// <returns></returns>
+ public SendGrid() : this(new Header())
+ {
+
+ }
+
+ public SendGrid(IHeader header)
+ {
+ _message = new MailMessage();
+ Header = header;
+ Headers = new Dictionary<string, string>();
+ }
+
+ public SendGrid(MailAddress from, MailAddress[] to, MailAddress[] cc, MailAddress[] bcc,
String subject, String html, String text, IHeader header = null) : this(header)
{
From = from;
@@ -38,41 +54,6 @@ namespace SendGridMail Html = html;
}
- internal SendGrid(IHeader header)
- {
- _message = new MailMessage();
- Header = header;
- Headers = new Dictionary<string, string>();
- }
-
- /// <summary>
- /// Creates an instance of SendGrid's custom message object
- /// </summary>
- /// <returns></returns>
- public static SendGrid GetInstance()
- {
- var header = new Header();
- return new SendGrid(header);
- }
-
- /// <summary>
- /// Creates an instance of SendGrid's custom message object with mail parameters
- /// </summary>
- /// <param name="from">The email address of the sender</param>
- /// <param name="to">An array of the recipients</param>
- /// <param name="cc">Supported over SMTP, with future plans for support in the Web transport</param>
- /// <param name="bcc">Blind recipients</param>
- /// <param name="subject">The subject of the message</param>
- /// <param name="html">the html content for the message</param>
- /// <param name="text">the plain text part of the message</param>
- /// <returns></returns>
- public static SendGrid GetInstance(MailAddress from, MailAddress[] to, MailAddress[] cc, MailAddress[] bcc,
- String subject, String html, String text)
- {
- var header = new Header();
- return new SendGrid(from, to, cc, bcc, subject, html, text, header);
- }
-
private static Dictionary<string, string> InitializeFilters()
{
return
|