diff options
Diffstat (limited to 'SendGrid/SendGridMail')
-rwxr-xr-x | SendGrid/SendGridMail/Header.cs | 7 | ||||
-rwxr-xr-x | SendGrid/SendGridMail/IHeader.cs | 7 | ||||
-rwxr-xr-x | SendGrid/SendGridMail/ISendGrid.cs | 7 | ||||
-rwxr-xr-x | SendGrid/SendGridMail/SendGrid.cs | 5 |
4 files changed, 26 insertions, 0 deletions
diff --git a/SendGrid/SendGridMail/Header.cs b/SendGrid/SendGridMail/Header.cs index be4ebeb..f8c9be8 100755 --- a/SendGrid/SendGridMail/Header.cs +++ b/SendGrid/SendGridMail/Header.cs @@ -50,6 +50,13 @@ namespace SendGridMail _settings.AddSetting(keys, category);
}
+ public void SetCategories(IEnumerable<string> categories)
+ {
+ if (categories == null) return;
+ var keys = new List<String> { "category" };
+ _settings.AddArray(keys, categories);
+ }
+
public void Enable(string filter)
{
AddFilterSetting(filter, new List<string>(){ "enable" }, "1");
diff --git a/SendGrid/SendGridMail/IHeader.cs b/SendGrid/SendGridMail/IHeader.cs index 3ec7911..cb1cc12 100755 --- a/SendGrid/SendGridMail/IHeader.cs +++ b/SendGrid/SendGridMail/IHeader.cs @@ -46,6 +46,13 @@ namespace SendGridMail void SetCategory(String category);
/// <summary>
+ /// This sets the categories for this email. Statistics are stored on a per category
+ /// basis, so this can be useful for tracking on a per group basis.
+ /// </summary>
+ /// <param name="categories">categories applied to the message</param>
+ void SetCategories(IEnumerable<string> categories);
+
+ /// <summary>
/// Shortcut method for enabling a filter.
/// </summary>
/// <param name="filter">The name of the filter to enable</param>
diff --git a/SendGrid/SendGridMail/ISendGrid.cs b/SendGrid/SendGridMail/ISendGrid.cs index a96e93c..9725be0 100755 --- a/SendGrid/SendGridMail/ISendGrid.cs +++ b/SendGrid/SendGridMail/ISendGrid.cs @@ -116,6 +116,13 @@ namespace SendGridMail void SetCategory(String category);
/// <summary>
+ /// This sets the categories for this email. Statistics are stored on a per category
+ /// basis, so this can be useful for tracking on a per group basis.
+ /// </summary>
+ /// <param name="categories">categories applied to the message</param>
+ void SetCategories(IEnumerable<String> categories);
+
+ /// <summary>
/// Add an attachment to the message.
/// </summary>
/// <param name="filePath">a fully qualified file path as a string</param>
diff --git a/SendGrid/SendGridMail/SendGrid.cs b/SendGrid/SendGridMail/SendGrid.cs index 0ee7079..f7901c1 100755 --- a/SendGrid/SendGridMail/SendGrid.cs +++ b/SendGrid/SendGridMail/SendGrid.cs @@ -305,6 +305,11 @@ namespace SendGridMail {
Header.SetCategory(category);
}
+
+ public void SetCategories(IEnumerable<string> categories)
+ {
+ Header.SetCategories(categories);
+ }
public void AddAttachment(Stream stream, String name)
{
|