diff options
author | paroos <pa.roos@icloud.com> | 2014-05-09 17:49:47 +0200 |
---|---|---|
committer | paroos <pa.roos@icloud.com> | 2014-05-09 17:49:47 +0200 |
commit | 3806e9f9c7dd393dc8c7e13447b0f29a733a136f (patch) | |
tree | 1683bc62f96404f0a2e59747d56ad24cfc2438f8 /SendGrid/SendGridMail/SendGrid.cs | |
parent | ddbdf03600227f4570af96a98ffd67d33d8b9743 (diff) | |
download | sendgrid-csharp-3806e9f9c7dd393dc8c7e13447b0f29a733a136f.zip sendgrid-csharp-3806e9f9c7dd393dc8c7e13447b0f29a733a136f.tar.gz sendgrid-csharp-3806e9f9c7dd393dc8c7e13447b0f29a733a136f.tar.bz2 |
Usable with an IoC Container
Diffstat (limited to 'SendGrid/SendGridMail/SendGrid.cs')
-rw-r--r-- | SendGrid/SendGridMail/SendGrid.cs | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/SendGrid/SendGridMail/SendGrid.cs b/SendGrid/SendGridMail/SendGrid.cs index cc87ffd..9708c82 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,23 +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>
|