diff --git a/readme.md b/readme.md index 3943028..0c0273c 100644 --- a/readme.md +++ b/readme.md @@ -65,13 +65,52 @@ If you want to have a plain text version of the newsletter as part of the same e ## Configuration ## The module supports sending emails through different mail senders (also called a ''sender engine''): + 1. Recommended: Mailgun (http://mailgun.com) or SendGrid (http://sendgrid.com) 1. Built-in SMTP support (default) -1. aspnetEmail component from [AdvancedIntellect](http://www.advancedintellect.com/product.aspx?smtp) (license purchase required). **Note!** This sender is not actively supported. +1. aspnetEmail component from [AdvancedIntellect](http://www.advancedintellect.com/product.aspx?smtp) (license purchase required). **Note!** This sender is not actively supported and will eventually be removed from the module. **Note!** We recommend using a cloud sender (Mailgun or SendGrid), as it has the most features and offloads the sending process to the cloud. -The aspnetEmail sender engine is included for backwards compatibility, but will eventually be removed from the module. +### Configuration Settings in web.config ### +When you install the module using Nuget, the following configuration is added to web.config: +```xml + +
+ +... + + + + + + + + + +``` +> Note! The configuration section was added in version 3.2.0. Prior to this, the sendertype was stored in ``. + +**Important!** When you uninstall the module, you need to remove the settings from web.config manually. + +#### Available Sender Engines #### +The default is the MailSenderNetSmtp engine. Change the `senderType` to select another sender engine. +SMTP Server: `` +Mailgun: `` +SendGrid: `` +> Note! Mailgun and SendGrid requires additional settings. + +### Recipient List Providers ### +You can configure which recipient list providers should be available for the user to add +```xml + + + + + + +``` +> Note! This configuration feature is not available prior to version 3.2.0 ### Configuring SMTP ### When installing the module, the default sender is the built-in SMTP client in .NET. In order to send emails using SMTP, you need to configure the standard `mailSettings` in web.config: @@ -100,9 +139,16 @@ You can also use a pick up directory if you have a SMTP server on your network t **Note!** The `pickupDirectoryLocation` can be on a network share. ### Configuring Mailgun ### -Add the following keys to the `` section in web.config to use Mailgun: +Change the `senderType` to the `` section in web.config to use Mailgun: +```xml + + ... + + +``` +You also need to add the following `` values in order for the Mailgun sender to be able to authenticate aginst it's REST API. + ```xml - diff --git a/src/InstallationResources/web.config.install.xdt b/src/InstallationResources/web.config.install.xdt new file mode 100644 index 0000000..3b52638 --- /dev/null +++ b/src/InstallationResources/web.config.install.xdt @@ -0,0 +1,24 @@ + + + +
+ + + + + + + + + + diff --git a/src/InstallationResources/web.config.uninstall.xdt b/src/InstallationResources/web.config.uninstall.xdt new file mode 100644 index 0000000..2469d9f --- /dev/null +++ b/src/InstallationResources/web.config.uninstall.xdt @@ -0,0 +1,24 @@ + + + +
+ + + + + + + + + + diff --git a/src/Newsletter for EPiServer.sln b/src/Newsletter for EPiServer.sln index 81f8a19..2846498 100644 --- a/src/Newsletter for EPiServer.sln +++ b/src/Newsletter for EPiServer.sln @@ -19,6 +19,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{7E EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EPiCode.Newsletter.SendGrid", "Newsletter.SendGrid\EPiCode.Newsletter.SendGrid.csproj", "{DC95640C-908A-49B6-B460-2157586A5DA2}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EPiCode.Newsletter.Configuration", "Newsletter.Configuration\EPiCode.Newsletter.Configuration.csproj", "{495118BF-965F-41B3-8077-4A1D789FCE51}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -37,6 +39,10 @@ Global {DC95640C-908A-49B6-B460-2157586A5DA2}.Debug|Any CPU.Build.0 = Debug|Any CPU {DC95640C-908A-49B6-B460-2157586A5DA2}.Release|Any CPU.ActiveCfg = Release|Any CPU {DC95640C-908A-49B6-B460-2157586A5DA2}.Release|Any CPU.Build.0 = Release|Any CPU + {495118BF-965F-41B3-8077-4A1D789FCE51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {495118BF-965F-41B3-8077-4A1D789FCE51}.Debug|Any CPU.Build.0 = Debug|Any CPU + {495118BF-965F-41B3-8077-4A1D789FCE51}.Release|Any CPU.ActiveCfg = Release|Any CPU + {495118BF-965F-41B3-8077-4A1D789FCE51}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/Newsletter.Configuration/EPiCode.Newsletter.Configuration.csproj b/src/Newsletter.Configuration/EPiCode.Newsletter.Configuration.csproj new file mode 100644 index 0000000..3aad33e --- /dev/null +++ b/src/Newsletter.Configuration/EPiCode.Newsletter.Configuration.csproj @@ -0,0 +1,75 @@ + + + + Debug + AnyCPU + 10.0.20723 + 2.0 + {495118BF-965F-41B3-8077-4A1D789FCE51} + Library + Properties + BVNetwork.EPiSendMail.Configuration + BVNetwork.EPiSendMail.Configuration + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + True + True + NewsletterConfigurationSection.csd + + + + + + + + + + CsdFileGenerator + NewsletterConfigurationSection1.csd.cs + + + NewsletterConfigurationSection.csd + + + NewsletterConfigurationSection.csd + + + NewsletterConfigurationSection.csd + Designer + + + + + \ No newline at end of file diff --git a/src/Newsletter.Configuration/NewsletterConfigurationSection.csd b/src/Newsletter.Configuration/NewsletterConfigurationSection.csd new file mode 100644 index 0000000..63a900e --- /dev/null +++ b/src/Newsletter.Configuration/NewsletterConfigurationSection.csd @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Newsletter.Configuration/NewsletterConfigurationSection.csd.config b/src/Newsletter.Configuration/NewsletterConfigurationSection.csd.config new file mode 100644 index 0000000..e163e41 --- /dev/null +++ b/src/Newsletter.Configuration/NewsletterConfigurationSection.csd.config @@ -0,0 +1,38 @@ + + + + +
+ + + + + + + + + + + diff --git a/src/Newsletter.Configuration/NewsletterConfigurationSection.csd.cs.older b/src/Newsletter.Configuration/NewsletterConfigurationSection.csd.cs.older new file mode 100644 index 0000000..23d197a --- /dev/null +++ b/src/Newsletter.Configuration/NewsletterConfigurationSection.csd.cs.older @@ -0,0 +1,405 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34209 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace BVNetwork.EPiSendMail.Configuration +{ + + + /// + /// The Newsletter Configuration Section. + /// + public partial class Newsletter : global::System.Configuration.ConfigurationSection + { + + #region Singleton Instance + /// + /// The XML name of the Newsletter Configuration Section. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string NewsletterSectionName = "epicodeNewsletter"; + + /// + /// The XML path of the Newsletter Configuration Section. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string NewsletterSectionPath = "epicodeNewsletter"; + + /// + /// Gets the Newsletter instance. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public static global::BVNetwork.EPiSendMail.Configuration.Newsletter Instance + { + get + { + return ((global::BVNetwork.EPiSendMail.Configuration.Newsletter)(global::System.Configuration.ConfigurationManager.GetSection(global::BVNetwork.EPiSendMail.Configuration.Newsletter.NewsletterSectionPath))); + } + } + #endregion + + #region Xmlns Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string XmlnsPropertyName = "xmlns"; + + /// + /// Gets the XML namespace of this Configuration Section. + /// + /// + /// This property makes sure that if the configuration file contains the XML namespace, + /// the parser doesn't throw an exception because it encounters the unknown "xmlns" attribute. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.Newsletter.XmlnsPropertyName, IsRequired=false, IsKey=false, IsDefaultCollection=false)] + public string Xmlns + { + get + { + return ((string)(base[global::BVNetwork.EPiSendMail.Configuration.Newsletter.XmlnsPropertyName])); + } + } + #endregion + + #region IsReadOnly override + /// + /// Gets a value indicating whether the element is read-only. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public override bool IsReadOnly() + { + return false; + } + #endregion + + #region SenderType Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string SenderTypePropertyName = "senderType"; + + /// + /// Gets or sets the SenderType. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.ComponentModel.DescriptionAttribute("The SenderType.")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.Newsletter.SenderTypePropertyName, IsRequired=false, IsKey=false, IsDefaultCollection=false)] + public virtual string SenderType + { + get + { + return ((string)(base[global::BVNetwork.EPiSendMail.Configuration.Newsletter.SenderTypePropertyName])); + } + set + { + base[global::BVNetwork.EPiSendMail.Configuration.Newsletter.SenderTypePropertyName] = value; + } + } + #endregion + + #region RecipientListProviders Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string RecipientListProvidersPropertyName = "recipientListProviders"; + + /// + /// Gets or sets the RecipientListProviders. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.ComponentModel.DescriptionAttribute("The RecipientListProviders.")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.Newsletter.RecipientListProvidersPropertyName, IsRequired=false, IsKey=false, IsDefaultCollection=false)] + public virtual global::BVNetwork.EPiSendMail.Configuration.RecipientListProviders RecipientListProviders + { + get + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProviders)(base[global::BVNetwork.EPiSendMail.Configuration.Newsletter.RecipientListProvidersPropertyName])); + } + set + { + base[global::BVNetwork.EPiSendMail.Configuration.Newsletter.RecipientListProvidersPropertyName] = value; + } + } + #endregion + } +} +namespace BVNetwork.EPiSendMail.Configuration +{ + + + /// + /// A collection of RecipientListProvider instances. + /// + [global::System.Configuration.ConfigurationCollectionAttribute(typeof(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider), CollectionType=global::System.Configuration.ConfigurationElementCollectionType.AddRemoveClearMap, AddItemName="add", RemoveItemName="remove", ClearItemsName="clear")] + public partial class RecipientListProviders : global::System.Configuration.ConfigurationElementCollection + { + + #region Constants + /// + /// The XML name of the individual instances in this collection. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string RecipientListProviderPropertyName = "recipientListProvider"; + #endregion + + #region Overrides + /// + /// Gets the type of the . + /// + /// The of this collection. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public override global::System.Configuration.ConfigurationElementCollectionType CollectionType + { + get + { + return global::System.Configuration.ConfigurationElementCollectionType.AddRemoveClearMap; + } + } + + /// + /// Gets the name used to identify this collection of elements + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + protected override string ElementName + { + get + { + return global::BVNetwork.EPiSendMail.Configuration.RecipientListProviders.RecipientListProviderPropertyName; + } + } + + /// + /// Indicates whether the specified exists in the . + /// + /// The name of the element to verify. + /// + /// if the element exists in the collection; otherwise, . + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + protected override bool IsElementName(string elementName) + { + return (elementName == global::BVNetwork.EPiSendMail.Configuration.RecipientListProviders.RecipientListProviderPropertyName); + } + + /// + /// Gets the element key for the specified configuration element. + /// + /// The to return the key for. + /// + /// An that acts as the key for the specified . + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + protected override object GetElementKey(global::System.Configuration.ConfigurationElement element) + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider)(element)).Name; + } + + /// + /// Creates a new . + /// + /// + /// A new . + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + protected override global::System.Configuration.ConfigurationElement CreateNewElement() + { + return new global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider(); + } + #endregion + + #region Indexer + /// + /// Gets the at the specified index. + /// + /// The index of the to retrieve. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider this[int index] + { + get + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider)(base.BaseGet(index))); + } + } + + /// + /// Gets the with the specified key. + /// + /// The key of the to retrieve. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider this[object name] + { + get + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider)(base.BaseGet(name))); + } + } + #endregion + + #region Add + /// + /// Adds the specified to the . + /// + /// The to add. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public void Add(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider recipientListProvider) + { + base.BaseAdd(recipientListProvider); + } + #endregion + + #region Remove + /// + /// Removes the specified from the . + /// + /// The to remove. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public void Remove(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider recipientListProvider) + { + base.BaseRemove(this.GetElementKey(recipientListProvider)); + } + #endregion + + #region GetItem + /// + /// Gets the at the specified index. + /// + /// The index of the to retrieve. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider GetItemAt(int index) + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider)(base.BaseGet(index))); + } + + /// + /// Gets the with the specified key. + /// + /// The key of the to retrieve. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider GetItemByKey(string name) + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider)(base.BaseGet(((object)(name))))); + } + #endregion + + #region IsReadOnly override + /// + /// Gets a value indicating whether the element is read-only. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public override bool IsReadOnly() + { + return false; + } + #endregion + } +} +namespace BVNetwork.EPiSendMail.Configuration +{ + + + /// + /// The RecipientListProvider Configuration Element. + /// + public partial class RecipientListProvider : global::System.Configuration.ConfigurationElement + { + + #region IsReadOnly override + /// + /// Gets a value indicating whether the element is read-only. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public override bool IsReadOnly() + { + return false; + } + #endregion + + #region Name Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string NamePropertyName = "name"; + + /// + /// Gets or sets the Name. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.ComponentModel.DescriptionAttribute("The Name.")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.NamePropertyName, IsRequired=true, IsKey=true, IsDefaultCollection=false)] + public virtual string Name + { + get + { + return ((string)(base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.NamePropertyName])); + } + set + { + base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.NamePropertyName] = value; + } + } + #endregion + + #region DisplayName Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string DisplayNamePropertyName = "displayName"; + + /// + /// Gets or sets the DisplayName. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.ComponentModel.DescriptionAttribute("The DisplayName.")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.DisplayNamePropertyName, IsRequired=true, IsKey=false, IsDefaultCollection=false)] + public virtual string DisplayName + { + get + { + return ((string)(base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.DisplayNamePropertyName])); + } + set + { + base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.DisplayNamePropertyName] = value; + } + } + #endregion + + #region Url Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string UrlPropertyName = "url"; + + /// + /// Gets or sets the Url. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.ComponentModel.DescriptionAttribute("The Url.")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.UrlPropertyName, IsRequired=true, IsKey=false, IsDefaultCollection=false)] + public virtual string Url + { + get + { + return ((string)(base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.UrlPropertyName])); + } + set + { + base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.UrlPropertyName] = value; + } + } + #endregion + } +} diff --git a/src/Newsletter.Configuration/NewsletterConfigurationSection.csd.diagram b/src/Newsletter.Configuration/NewsletterConfigurationSection.csd.diagram new file mode 100644 index 0000000..a1466a5 --- /dev/null +++ b/src/Newsletter.Configuration/NewsletterConfigurationSection.csd.diagram @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Newsletter.Configuration/NewsletterConfigurationSection.csd.xsd b/src/Newsletter.Configuration/NewsletterConfigurationSection.csd.xsd new file mode 100644 index 0000000..2861032 --- /dev/null +++ b/src/Newsletter.Configuration/NewsletterConfigurationSection.csd.xsd @@ -0,0 +1,62 @@ + + + + + + + + + The RecipientListProviders. + + + + + + The SenderType. + + + + + + + + + + The RecipientListProvider Configuration Element. + + + + + + + + The Name. + + + + + + + + The Name. + + + + + The DisplayName. + + + + + The Url. + + + + diff --git a/src/Newsletter.Configuration/NewsletterConfigurationSection1.csd.cs b/src/Newsletter.Configuration/NewsletterConfigurationSection1.csd.cs new file mode 100644 index 0000000..f2460f5 --- /dev/null +++ b/src/Newsletter.Configuration/NewsletterConfigurationSection1.csd.cs @@ -0,0 +1,405 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34209 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace BVNetwork.EPiSendMail.Configuration +{ + + + /// + /// The NewsletterConfigurationSection Configuration Section. + /// + public partial class NewsletterConfigurationSection : global::System.Configuration.ConfigurationSection + { + + #region Singleton Instance + /// + /// The XML name of the NewsletterConfigurationSection Configuration Section. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string NewsletterConfigurationSectionSectionName = "epicodeNewsletter"; + + /// + /// The XML path of the NewsletterConfigurationSection Configuration Section. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string NewsletterConfigurationSectionSectionPath = "epicodeNewsletter"; + + /// + /// Gets the NewsletterConfigurationSection instance. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public static global::BVNetwork.EPiSendMail.Configuration.NewsletterConfigurationSection Instance + { + get + { + return ((global::BVNetwork.EPiSendMail.Configuration.NewsletterConfigurationSection)(global::System.Configuration.ConfigurationManager.GetSection(global::BVNetwork.EPiSendMail.Configuration.NewsletterConfigurationSection.NewsletterConfigurationSectionSectionPath))); + } + } + #endregion + + #region Xmlns Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string XmlnsPropertyName = "xmlns"; + + /// + /// Gets the XML namespace of this Configuration Section. + /// + /// + /// This property makes sure that if the configuration file contains the XML namespace, + /// the parser doesn't throw an exception because it encounters the unknown "xmlns" attribute. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.NewsletterConfigurationSection.XmlnsPropertyName, IsRequired=false, IsKey=false, IsDefaultCollection=false)] + public string Xmlns + { + get + { + return ((string)(base[global::BVNetwork.EPiSendMail.Configuration.NewsletterConfigurationSection.XmlnsPropertyName])); + } + } + #endregion + + #region IsReadOnly override + /// + /// Gets a value indicating whether the element is read-only. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public override bool IsReadOnly() + { + return false; + } + #endregion + + #region SenderType Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string SenderTypePropertyName = "senderType"; + + /// + /// Gets or sets the SenderType. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.ComponentModel.DescriptionAttribute("The SenderType.")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.NewsletterConfigurationSection.SenderTypePropertyName, IsRequired=false, IsKey=false, IsDefaultCollection=false)] + public virtual string SenderType + { + get + { + return ((string)(base[global::BVNetwork.EPiSendMail.Configuration.NewsletterConfigurationSection.SenderTypePropertyName])); + } + set + { + base[global::BVNetwork.EPiSendMail.Configuration.NewsletterConfigurationSection.SenderTypePropertyName] = value; + } + } + #endregion + + #region RecipientListProviders Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string RecipientListProvidersPropertyName = "recipientListProviders"; + + /// + /// Gets or sets the RecipientListProviders. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.ComponentModel.DescriptionAttribute("The RecipientListProviders.")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.NewsletterConfigurationSection.RecipientListProvidersPropertyName, IsRequired=false, IsKey=false, IsDefaultCollection=false)] + public virtual global::BVNetwork.EPiSendMail.Configuration.RecipientListProviders RecipientListProviders + { + get + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProviders)(base[global::BVNetwork.EPiSendMail.Configuration.NewsletterConfigurationSection.RecipientListProvidersPropertyName])); + } + set + { + base[global::BVNetwork.EPiSendMail.Configuration.NewsletterConfigurationSection.RecipientListProvidersPropertyName] = value; + } + } + #endregion + } +} +namespace BVNetwork.EPiSendMail.Configuration +{ + + + /// + /// A collection of RecipientListProvider instances. + /// + [global::System.Configuration.ConfigurationCollectionAttribute(typeof(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider), CollectionType=global::System.Configuration.ConfigurationElementCollectionType.AddRemoveClearMap, AddItemName="add", RemoveItemName="remove", ClearItemsName="clear")] + public partial class RecipientListProviders : global::System.Configuration.ConfigurationElementCollection + { + + #region Constants + /// + /// The XML name of the individual instances in this collection. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string RecipientListProviderPropertyName = "recipientListProvider"; + #endregion + + #region Overrides + /// + /// Gets the type of the . + /// + /// The of this collection. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public override global::System.Configuration.ConfigurationElementCollectionType CollectionType + { + get + { + return global::System.Configuration.ConfigurationElementCollectionType.AddRemoveClearMap; + } + } + + /// + /// Gets the name used to identify this collection of elements + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + protected override string ElementName + { + get + { + return global::BVNetwork.EPiSendMail.Configuration.RecipientListProviders.RecipientListProviderPropertyName; + } + } + + /// + /// Indicates whether the specified exists in the . + /// + /// The name of the element to verify. + /// + /// if the element exists in the collection; otherwise, . + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + protected override bool IsElementName(string elementName) + { + return (elementName == global::BVNetwork.EPiSendMail.Configuration.RecipientListProviders.RecipientListProviderPropertyName); + } + + /// + /// Gets the element key for the specified configuration element. + /// + /// The to return the key for. + /// + /// An that acts as the key for the specified . + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + protected override object GetElementKey(global::System.Configuration.ConfigurationElement element) + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider)(element)).Name; + } + + /// + /// Creates a new . + /// + /// + /// A new . + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + protected override global::System.Configuration.ConfigurationElement CreateNewElement() + { + return new global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider(); + } + #endregion + + #region Indexer + /// + /// Gets the at the specified index. + /// + /// The index of the to retrieve. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider this[int index] + { + get + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider)(base.BaseGet(index))); + } + } + + /// + /// Gets the with the specified key. + /// + /// The key of the to retrieve. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider this[object name] + { + get + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider)(base.BaseGet(name))); + } + } + #endregion + + #region Add + /// + /// Adds the specified to the . + /// + /// The to add. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public void Add(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider recipientListProvider) + { + base.BaseAdd(recipientListProvider); + } + #endregion + + #region Remove + /// + /// Removes the specified from the . + /// + /// The to remove. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public void Remove(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider recipientListProvider) + { + base.BaseRemove(this.GetElementKey(recipientListProvider)); + } + #endregion + + #region GetItem + /// + /// Gets the at the specified index. + /// + /// The index of the to retrieve. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider GetItemAt(int index) + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider)(base.BaseGet(index))); + } + + /// + /// Gets the with the specified key. + /// + /// The key of the to retrieve. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider GetItemByKey(string name) + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider)(base.BaseGet(((object)(name))))); + } + #endregion + + #region IsReadOnly override + /// + /// Gets a value indicating whether the element is read-only. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public override bool IsReadOnly() + { + return false; + } + #endregion + } +} +namespace BVNetwork.EPiSendMail.Configuration +{ + + + /// + /// The RecipientListProvider Configuration Element. + /// + public partial class RecipientListProvider : global::System.Configuration.ConfigurationElement + { + + #region IsReadOnly override + /// + /// Gets a value indicating whether the element is read-only. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public override bool IsReadOnly() + { + return false; + } + #endregion + + #region Name Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string NamePropertyName = "name"; + + /// + /// Gets or sets the Name. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.ComponentModel.DescriptionAttribute("The Name.")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.NamePropertyName, IsRequired=true, IsKey=true, IsDefaultCollection=false)] + public virtual string Name + { + get + { + return ((string)(base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.NamePropertyName])); + } + set + { + base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.NamePropertyName] = value; + } + } + #endregion + + #region DisplayName Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string DisplayNamePropertyName = "displayName"; + + /// + /// Gets or sets the DisplayName. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.ComponentModel.DescriptionAttribute("The DisplayName.")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.DisplayNamePropertyName, IsRequired=true, IsKey=false, IsDefaultCollection=false)] + public virtual string DisplayName + { + get + { + return ((string)(base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.DisplayNamePropertyName])); + } + set + { + base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.DisplayNamePropertyName] = value; + } + } + #endregion + + #region Url Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string UrlPropertyName = "url"; + + /// + /// Gets or sets the Url. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.ComponentModel.DescriptionAttribute("The Url.")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.UrlPropertyName, IsRequired=true, IsKey=false, IsDefaultCollection=false)] + public virtual string Url + { + get + { + return ((string)(base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.UrlPropertyName])); + } + set + { + base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.UrlPropertyName] = value; + } + } + #endregion + } +} diff --git a/src/Newsletter.Configuration/NewsletterConfigurationSection1.csd.cs.old b/src/Newsletter.Configuration/NewsletterConfigurationSection1.csd.cs.old new file mode 100644 index 0000000..23d197a --- /dev/null +++ b/src/Newsletter.Configuration/NewsletterConfigurationSection1.csd.cs.old @@ -0,0 +1,405 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34209 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace BVNetwork.EPiSendMail.Configuration +{ + + + /// + /// The Newsletter Configuration Section. + /// + public partial class Newsletter : global::System.Configuration.ConfigurationSection + { + + #region Singleton Instance + /// + /// The XML name of the Newsletter Configuration Section. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string NewsletterSectionName = "epicodeNewsletter"; + + /// + /// The XML path of the Newsletter Configuration Section. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string NewsletterSectionPath = "epicodeNewsletter"; + + /// + /// Gets the Newsletter instance. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public static global::BVNetwork.EPiSendMail.Configuration.Newsletter Instance + { + get + { + return ((global::BVNetwork.EPiSendMail.Configuration.Newsletter)(global::System.Configuration.ConfigurationManager.GetSection(global::BVNetwork.EPiSendMail.Configuration.Newsletter.NewsletterSectionPath))); + } + } + #endregion + + #region Xmlns Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string XmlnsPropertyName = "xmlns"; + + /// + /// Gets the XML namespace of this Configuration Section. + /// + /// + /// This property makes sure that if the configuration file contains the XML namespace, + /// the parser doesn't throw an exception because it encounters the unknown "xmlns" attribute. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.Newsletter.XmlnsPropertyName, IsRequired=false, IsKey=false, IsDefaultCollection=false)] + public string Xmlns + { + get + { + return ((string)(base[global::BVNetwork.EPiSendMail.Configuration.Newsletter.XmlnsPropertyName])); + } + } + #endregion + + #region IsReadOnly override + /// + /// Gets a value indicating whether the element is read-only. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public override bool IsReadOnly() + { + return false; + } + #endregion + + #region SenderType Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string SenderTypePropertyName = "senderType"; + + /// + /// Gets or sets the SenderType. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.ComponentModel.DescriptionAttribute("The SenderType.")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.Newsletter.SenderTypePropertyName, IsRequired=false, IsKey=false, IsDefaultCollection=false)] + public virtual string SenderType + { + get + { + return ((string)(base[global::BVNetwork.EPiSendMail.Configuration.Newsletter.SenderTypePropertyName])); + } + set + { + base[global::BVNetwork.EPiSendMail.Configuration.Newsletter.SenderTypePropertyName] = value; + } + } + #endregion + + #region RecipientListProviders Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string RecipientListProvidersPropertyName = "recipientListProviders"; + + /// + /// Gets or sets the RecipientListProviders. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.ComponentModel.DescriptionAttribute("The RecipientListProviders.")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.Newsletter.RecipientListProvidersPropertyName, IsRequired=false, IsKey=false, IsDefaultCollection=false)] + public virtual global::BVNetwork.EPiSendMail.Configuration.RecipientListProviders RecipientListProviders + { + get + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProviders)(base[global::BVNetwork.EPiSendMail.Configuration.Newsletter.RecipientListProvidersPropertyName])); + } + set + { + base[global::BVNetwork.EPiSendMail.Configuration.Newsletter.RecipientListProvidersPropertyName] = value; + } + } + #endregion + } +} +namespace BVNetwork.EPiSendMail.Configuration +{ + + + /// + /// A collection of RecipientListProvider instances. + /// + [global::System.Configuration.ConfigurationCollectionAttribute(typeof(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider), CollectionType=global::System.Configuration.ConfigurationElementCollectionType.AddRemoveClearMap, AddItemName="add", RemoveItemName="remove", ClearItemsName="clear")] + public partial class RecipientListProviders : global::System.Configuration.ConfigurationElementCollection + { + + #region Constants + /// + /// The XML name of the individual instances in this collection. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string RecipientListProviderPropertyName = "recipientListProvider"; + #endregion + + #region Overrides + /// + /// Gets the type of the . + /// + /// The of this collection. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public override global::System.Configuration.ConfigurationElementCollectionType CollectionType + { + get + { + return global::System.Configuration.ConfigurationElementCollectionType.AddRemoveClearMap; + } + } + + /// + /// Gets the name used to identify this collection of elements + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + protected override string ElementName + { + get + { + return global::BVNetwork.EPiSendMail.Configuration.RecipientListProviders.RecipientListProviderPropertyName; + } + } + + /// + /// Indicates whether the specified exists in the . + /// + /// The name of the element to verify. + /// + /// if the element exists in the collection; otherwise, . + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + protected override bool IsElementName(string elementName) + { + return (elementName == global::BVNetwork.EPiSendMail.Configuration.RecipientListProviders.RecipientListProviderPropertyName); + } + + /// + /// Gets the element key for the specified configuration element. + /// + /// The to return the key for. + /// + /// An that acts as the key for the specified . + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + protected override object GetElementKey(global::System.Configuration.ConfigurationElement element) + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider)(element)).Name; + } + + /// + /// Creates a new . + /// + /// + /// A new . + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + protected override global::System.Configuration.ConfigurationElement CreateNewElement() + { + return new global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider(); + } + #endregion + + #region Indexer + /// + /// Gets the at the specified index. + /// + /// The index of the to retrieve. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider this[int index] + { + get + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider)(base.BaseGet(index))); + } + } + + /// + /// Gets the with the specified key. + /// + /// The key of the to retrieve. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider this[object name] + { + get + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider)(base.BaseGet(name))); + } + } + #endregion + + #region Add + /// + /// Adds the specified to the . + /// + /// The to add. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public void Add(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider recipientListProvider) + { + base.BaseAdd(recipientListProvider); + } + #endregion + + #region Remove + /// + /// Removes the specified from the . + /// + /// The to remove. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public void Remove(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider recipientListProvider) + { + base.BaseRemove(this.GetElementKey(recipientListProvider)); + } + #endregion + + #region GetItem + /// + /// Gets the at the specified index. + /// + /// The index of the to retrieve. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider GetItemAt(int index) + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider)(base.BaseGet(index))); + } + + /// + /// Gets the with the specified key. + /// + /// The key of the to retrieve. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider GetItemByKey(string name) + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider)(base.BaseGet(((object)(name))))); + } + #endregion + + #region IsReadOnly override + /// + /// Gets a value indicating whether the element is read-only. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public override bool IsReadOnly() + { + return false; + } + #endregion + } +} +namespace BVNetwork.EPiSendMail.Configuration +{ + + + /// + /// The RecipientListProvider Configuration Element. + /// + public partial class RecipientListProvider : global::System.Configuration.ConfigurationElement + { + + #region IsReadOnly override + /// + /// Gets a value indicating whether the element is read-only. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public override bool IsReadOnly() + { + return false; + } + #endregion + + #region Name Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string NamePropertyName = "name"; + + /// + /// Gets or sets the Name. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.ComponentModel.DescriptionAttribute("The Name.")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.NamePropertyName, IsRequired=true, IsKey=true, IsDefaultCollection=false)] + public virtual string Name + { + get + { + return ((string)(base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.NamePropertyName])); + } + set + { + base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.NamePropertyName] = value; + } + } + #endregion + + #region DisplayName Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string DisplayNamePropertyName = "displayName"; + + /// + /// Gets or sets the DisplayName. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.ComponentModel.DescriptionAttribute("The DisplayName.")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.DisplayNamePropertyName, IsRequired=true, IsKey=false, IsDefaultCollection=false)] + public virtual string DisplayName + { + get + { + return ((string)(base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.DisplayNamePropertyName])); + } + set + { + base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.DisplayNamePropertyName] = value; + } + } + #endregion + + #region Url Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string UrlPropertyName = "url"; + + /// + /// Gets or sets the Url. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.ComponentModel.DescriptionAttribute("The Url.")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.UrlPropertyName, IsRequired=true, IsKey=false, IsDefaultCollection=false)] + public virtual string Url + { + get + { + return ((string)(base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.UrlPropertyName])); + } + set + { + base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.UrlPropertyName] = value; + } + } + #endregion + } +} diff --git a/src/Newsletter.Configuration/Properties/AssemblyInfo.cs b/src/Newsletter.Configuration/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e291ed2 --- /dev/null +++ b/src/Newsletter.Configuration/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("BVNetwork.EPiSendMail.Configuration")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("BVNetwork.EPiSendMail.Configuration")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("991bc92a-ea4a-49c0-9e32-b554ad51a8ea")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Newsletter/Api/ApiBaseController.cs b/src/Newsletter/Api/ApiBaseController.cs new file mode 100644 index 0000000..a682342 --- /dev/null +++ b/src/Newsletter/Api/ApiBaseController.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web.Http; +using Newtonsoft.Json.Linq; + +namespace BVNetwork.EPiSendMail.Api +{ + public class ApiBaseController : ApiController + { + protected JObject GetJsonResult(T result) + { + return JObject.FromObject(result); + } + + } +} diff --git a/src/Newsletter/Api/RecipientListController.cs b/src/Newsletter/Api/RecipientListController.cs index f69a77e..c99c962 100644 --- a/src/Newsletter/Api/RecipientListController.cs +++ b/src/Newsletter/Api/RecipientListController.cs @@ -4,12 +4,26 @@ using BVNetwork.EPiSendMail.Api.Models; using BVNetwork.EPiSendMail.DataAccess; using BVNetwork.EPiSendMail.Plugin.WorkItemProviders; +using Newtonsoft.Json.Linq; namespace BVNetwork.EPiSendMail.Api { [Authorize(Roles = "NewsletterEditors, CmsAdmins")] - public class RecipientListController : ApiController + public class RecipientListController : ApiBaseController { + + [HttpGet] + public HttpResponseMessage Get(int id) + { + RecipientList list = RecipientList.Load(id); + if (list == null) + { + throw new HttpResponseException(HttpStatusCode.NotFound); + } + + return Request.CreateResponse(HttpStatusCode.OK, GetJsonResult(list)); + } + /// /// Deletes the specified Recipient List. /// @@ -22,7 +36,6 @@ public HttpResponseMessage Delete(int id) if (list == null) { throw new HttpResponseException(HttpStatusCode.NotFound); - } list.Delete(); diff --git a/src/Newsletter/Api/RecipientsController.cs b/src/Newsletter/Api/RecipientsController.cs index e97fd9c..34c2207 100644 --- a/src/Newsletter/Api/RecipientsController.cs +++ b/src/Newsletter/Api/RecipientsController.cs @@ -1,20 +1,122 @@ -using System.Web.Http; +using System.Collections.Generic; +using System.Net; +using System.Net.Http; +using System.Web.Http; +using System.Web.Security; using BVNetwork.EPiSendMail.Api.Models; +using BVNetwork.EPiSendMail.DataAccess; using BVNetwork.EPiSendMail.Plugin.WorkItemProviders; namespace BVNetwork.EPiSendMail.Api { [Authorize(Roles = "NewsletterEditors, CmsAdmins")] - public class RecipientsController : ApiController + public class RecipientsController : ApiBaseController { [HttpPost] - public RecipientStatus AddRecipientsFromEPiServerGroupname(int jobId, string groupName) + public HttpResponseMessage AddRecipientsToJobFromEPiServerGroupname(int id, string groupName) { - EPiServerGroupProvider recipients = new EPiServerGroupProvider(); + Job job = Job.Load(id); + if(job != null) + { + return Request.CreateResponse(HttpStatusCode.OK, + GetJsonResult(AddEPiServerGroupRecipients(job, groupName))); + } + + return Request.CreateErrorResponse(HttpStatusCode.NotFound, "Job not found"); + } + + [HttpPost] + public HttpResponseMessage AddRecipientsToListFromEPiServerGroupname(int id, string groupName) + { + RecipientList list = RecipientList.Load(id); + if(list != null) + { + return Request.CreateResponse(HttpStatusCode.OK, + GetJsonResult(AddEPiServerGroupRecipients(list, groupName))); + } + + return Request.CreateErrorResponse(HttpStatusCode.NotFound, "List not found"); + } + + [HttpPost] + public HttpResponseMessage AddRecipientsToListFromList(int sourceListId, int destinationListId) + { + RecipientList destList = RecipientList.Load(destinationListId); + RecipientList sourceList = RecipientList.Load(sourceListId); + if (destList != null && sourceList != null) + { + int addedAddresses = destList.AddRecipientItemsFromRecipientList(sourceList.Id); + RecipientStatus status = new RecipientStatus {ImportedEmails = addedAddresses}; + + return Request.CreateResponse(HttpStatusCode.OK, + GetJsonResult(status)); + } + + return Request.CreateErrorResponse(HttpStatusCode.NotFound, "Source or Destination list not found"); + } + + [HttpPost] + public HttpResponseMessage AddRecipientsToJobFromList(int sourceListId, int jobId) + { + Job job = Job.Load(jobId); + if (job == null) + { + return Request.CreateErrorResponse(HttpStatusCode.NotFound, "Job not found"); + } + RecipientList sourceList = RecipientList.Load(sourceListId); + if (sourceList == null) + { + return Request.CreateErrorResponse(HttpStatusCode.NotFound, "Source list not found"); + } + + int addedAddresses = job.AddWorkItemsFromRecipientList(sourceList.Id); + RecipientStatus status = new RecipientStatus {ImportedEmails = addedAddresses}; + + return Request.CreateResponse(HttpStatusCode.OK, GetJsonResult(status)); + } + + + protected RecipientStatus AddEPiServerGroupRecipients(IEmailImporter importer, string groupName) + { + RecipientStatus status = new RecipientStatus(); - RecipientStatus status = recipients.AddEPiServerGroupRecipients(jobId, groupName); + List addresses = new List(); + string[] usersInRole = Roles.GetUsersInRole(groupName); + + foreach (string userName in usersInRole) + { + MembershipUser user = Membership.GetUser(userName); + if (user != null && string.IsNullOrEmpty(user.Email) == false) + addresses.Add(user.Email); + } + + if (addresses.Count == 0) + { + status.Status = "Could not find any email addresses for users in the EPiServer group."; + return status; + } + + // Add the items + List duplicateAddresses; + List invalidAddresses; + + System.Diagnostics.Stopwatch tmr = System.Diagnostics.Stopwatch.StartNew(); + int count = importer.ImportEmailAddresses(addresses.ToArray(), out invalidAddresses, out duplicateAddresses); + tmr.Stop(); + + if (invalidAddresses.Count > 0) + { + status.InvalidMessage = string.Join(", ", invalidAddresses.ToArray()); + } + + status.ImportedEmails = count; + status.DuplicatedEmails = duplicateAddresses.Count; + status.InvalidEmails = invalidAddresses.Count; + status.TimeToImport = tmr.ElapsedMilliseconds; + status.Status = "Import ok"; return status; } + } } diff --git a/src/Newsletter/Api/SubscriptionController.cs b/src/Newsletter/Api/SubscriptionController.cs index f3fc818..133d06b 100644 --- a/src/Newsletter/Api/SubscriptionController.cs +++ b/src/Newsletter/Api/SubscriptionController.cs @@ -12,7 +12,7 @@ namespace BVNetwork.EPiSendMail.Api { - public class SubscriptionController : ApiController + public class SubscriptionController : ApiBaseController { private static log4net.ILog _log = log4net.LogManager.GetLogger(typeof(SubscriptionController)); @@ -128,7 +128,7 @@ public List ValidateRecipientList(int recipientList, int blockList) return result; } - protected static JObject GetSubscriptionResult(bool result) + protected JObject GetSubscriptionResult(bool result) { return JObject.FromObject(new { diff --git a/src/Newsletter/Configuration/NewsLetterConfiguration.cs b/src/Newsletter/Configuration/NewsLetterConfiguration.cs index 80ad3df..eceddc5 100644 --- a/src/Newsletter/Configuration/NewsLetterConfiguration.cs +++ b/src/Newsletter/Configuration/NewsLetterConfiguration.cs @@ -6,6 +6,7 @@ using System.Web.Configuration; using BVNetwork.EPiSendMail.DataAccess; using BVNetwork.EPiSendMail.Library; +using BVNetwork.EPiSendMail.Plugin; using EPiServer; using EPiServer.Core; using EPiServer.DataAbstraction; @@ -307,5 +308,66 @@ public static NameValueCollection GetRecipientListProviders() return config; } + + /// + /// Gets the recipient list provider descriptors. + /// + /// A list of all the configured recipient list providers + public static List GetRecipientListProviderDescriptors() + { + List providerList; + if(NewsletterConfigurationSection.Instance.RecipientListProviders.Count > 0) + { + providerList = new List(); + foreach (RecipientListProvider provider in NewsletterConfigurationSection.Instance.RecipientListProviders) + { + providerList.Add(new RecipientListProviderDescriptor( + provider.Name, provider.DisplayName, provider.Url)); + } + } + else + { + // Nothing configured, + providerList = GetDefaultRecipientListProviders(); + } + return providerList; + } + + private static List GetDefaultRecipientListProviders() + { + + List providerList = new List(); + providerList.Add(new RecipientListProviderDescriptor( + "RecipientList", + "Add from one of your Recipient Lists", + BVNetwork.EPiSendMail.Configuration.NewsLetterConfiguration.GetModuleBaseDir() + + "/plugin/itemproviders/recipientprovider.ascx" + )); + + providerList.Add(new RecipientListProviderDescriptor( + "TextImport", + "Import from text", + BVNetwork.EPiSendMail.Configuration.NewsLetterConfiguration.GetModuleBaseDir() + + "/plugin/itemproviders/TextImportProvider.ascx" + )); + + providerList.Add(new RecipientListProviderDescriptor( + "EPiServerGroup", + "Add email addresses from an EPiServer Group", + BVNetwork.EPiSendMail.Configuration.NewsLetterConfiguration.GetModuleBaseDir() + + "/plugin/itemproviders/EPiServerGroupProvider.ascx" + )); + + providerList.Add(new RecipientListProviderDescriptor( + "CommerceUsers", + "Add email addresses from Commerce Contacts", + BVNetwork.EPiSendMail.Configuration.NewsLetterConfiguration.GetModuleBaseDir() + + "/plugin/itemproviders/CommerceUsersProvider.ascx" + )); + + return providerList; + } + + } } diff --git a/src/Newsletter/DataAccess/IEmailImporter.cs b/src/Newsletter/DataAccess/IEmailImporter.cs new file mode 100644 index 0000000..573a73d --- /dev/null +++ b/src/Newsletter/DataAccess/IEmailImporter.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; + +namespace BVNetwork.EPiSendMail.DataAccess +{ + public interface IEmailImporter + { + int ImportEmailAddresses(string emailAddressesDelimited, out List invalidEmailAddresses, out List duplicateAddresses); + + /// + /// Imports email addresses into a Recipient List + /// + /// The email addresses to import. + /// The number of email addresses imported as new work items. Duplicates are not part of this number. + int ImportEmailAddresses(string[] emailArray); + + /// + /// Imports email addresses into a Recipient List + /// + /// The email addresses to import. + /// A list of all available email addresses that could not be parsed as a valid address + /// The number of email addresses imported as new work items. Duplicates are not part of this number. + int ImportEmailAddresses(string[] emailArray, out List invalidEmailAddresses, out List duplicateAddresses); + } +} \ No newline at end of file diff --git a/src/Newsletter/DataAccess/Job.cs b/src/Newsletter/DataAccess/Job.cs index 92858d0..f41118b 100644 --- a/src/Newsletter/DataAccess/Job.cs +++ b/src/Newsletter/DataAccess/Job.cs @@ -8,7 +8,7 @@ namespace BVNetwork.EPiSendMail.DataAccess { - public class Job + public class Job : IEmailImporter { private int _id = 0; private JobWorkItems _workItems = null; diff --git a/src/Newsletter/DataAccess/RecipientList.cs b/src/Newsletter/DataAccess/RecipientList.cs index fd52e62..426b544 100644 --- a/src/Newsletter/DataAccess/RecipientList.cs +++ b/src/Newsletter/DataAccess/RecipientList.cs @@ -3,10 +3,11 @@ using System.Data; using System.Linq; using BVNetwork.EPiSendMail.DataAccess.DataUtil; +using Newtonsoft.Json; namespace BVNetwork.EPiSendMail.DataAccess { - public class RecipientList + public class RecipientList : IEmailImporter { private RecipientListType _type = RecipientListType.PrivateList; private int _id = 0; @@ -184,6 +185,7 @@ public string Description /// in the database. /// /// The email addresses. + [JsonIgnore] public EmailAddresses EmailAddresses { get diff --git a/src/Newsletter/EPiCode.Newsletter.csproj b/src/Newsletter/EPiCode.Newsletter.csproj index f300330..c806454 100644 --- a/src/Newsletter/EPiCode.Newsletter.csproj +++ b/src/Newsletter/EPiCode.Newsletter.csproj @@ -205,6 +205,10 @@ + + Configuration\NewsletterConfigurationSection1.csd.cs + + @@ -231,6 +235,7 @@ + @@ -294,6 +299,7 @@ NewsLetterInstall.aspx + AddWorkItems.ascx ASPXCodeBehind @@ -416,26 +422,12 @@ WorkItemsEdit.aspx - - EPiServerGroupProvider.ascx - ASPXCodeBehind - - - EPiServerGroupProvider.ascx - - - RecipientProvider.ascx - ASPXCodeBehind - - - RecipientProvider.ascx - - + TextImportProvider.ascx ASPXCodeBehind - + TextImportProvider.ascx @@ -494,11 +486,11 @@ StatusMessage.ascx - + EPiServerGroupProvider.ascx ASPXCodeBehind - + EPiServerGroupProvider.ascx @@ -515,19 +507,12 @@ TextRemoveProvider.ascx - - TextImportProvider.ascx - ASPXCodeBehind - - - TextImportProvider.ascx - - + RecipientProvider.ascx ASPXCodeBehind - + RecipientProvider.ascx @@ -603,11 +588,7 @@ ASPXCodeBehind - - ASPXCodeBehind - - - + ASPXCodeBehind @@ -621,7 +602,9 @@ ASPXCodeBehind - + + ASPXCodeBehind + ASPXCodeBehind @@ -631,17 +614,14 @@ ASPXCodeBehind - - - ASPXCodeBehind - - + ASPXCodeBehind - + ASPXCodeBehind - + + ASPXCodeBehind @@ -673,31 +653,32 @@ - - @echo off - echo POST BUILD EVENT DISABLED - goto continue + @echo off +echo Copy "$(TargetDir)$(TargetName).*" to "C:\EPiServer\Demo78\Demo78\bin\" +copy "$(TargetDir)$(TargetName).*" "C:\EPiServer\Demo78\Demo78\bin\" +REM echo POST BUILD EVENT DISABLED +goto continue - echo Running custom deployment script from: $(SolutionDir) +echo Running custom deployment script from: $(SolutionDir) - REM Don't copy if there is no solution defined - set solutionName=$(SolutionName) - if "%25solutionName%25"=="*Undefined*" GOTO Skip +REM Don't copy if there is no solution defined +set solutionName=$(SolutionName) +if "%25solutionName%25"=="*Undefined*" GOTO Skip - if exist $(SolutionDir)DeployNewsletter.cmd ( - call $(SolutionDir)DeployNewsletter.cmd $(ConfigurationName) "$(ProjectDir)" "$(TargetDir)" "$(SolutionDir)" - goto continue - ) else ( - echo No custom deployment will be performed. - echo $(SolutionDir)DeployNewsletter.cmd does not exist. - goto continue - ) +if exist $(SolutionDir)DeployNewsletter.cmd ( +call $(SolutionDir)DeployNewsletter.cmd $(ConfigurationName) "$(ProjectDir)" "$(TargetDir)" "$(SolutionDir)" +goto continue +) else ( +echo No custom deployment will be performed. +echo $(SolutionDir)DeployNewsletter.cmd does not exist. +goto continue +) - :skip - echo No solution, skipping deployment step +:skip +echo No solution, skipping deployment step - :continue - +:continue + diff --git a/src/Newsletter/EPiCode.Newsletter.nuspec b/src/Newsletter/EPiCode.Newsletter.nuspec index 2749ff6..f765df3 100644 --- a/src/Newsletter/EPiCode.Newsletter.nuspec +++ b/src/Newsletter/EPiCode.Newsletter.nuspec @@ -36,6 +36,14 @@ + + + + -<%@ Import Namespace="BVNetwork.EPiSendMail.Configuration" %> - +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EPiServerGroupProvider.ascx.cs" Inherits="BVNetwork.EPiSendMail.Plugin.ItemProviders.EPiServerGroupProvider" %> - Select EPiServer group to add users as worker items: + Select EPiServer group to add email addresses from:
+ + + +

Select a recipient list:

+ + +
+ + + + + + + + + + + + + + + + + + + +
 NameTypeCountDescription
+ + <%# Eval("Name") %><%# Eval("ListType") %><%# Eval("EmailAddressCount") %><%# Eval("Description") %>
+
+ +
+
+ + + + diff --git a/src/Newsletter/Plugin/ItemProviders/RecipientProvider.ascx.cs b/src/Newsletter/Plugin/ItemProviders/RecipientProvider.ascx.cs new file mode 100644 index 0000000..3d0e0c0 --- /dev/null +++ b/src/Newsletter/Plugin/ItemProviders/RecipientProvider.ascx.cs @@ -0,0 +1,52 @@ +using System; +using System.Web.UI.WebControls; +using BVNetwork.EPiSendMail.Configuration; +using BVNetwork.EPiSendMail.DataAccess; +using BVNetwork.EPiSendMail.Plugin.ItemProviders; + +namespace BVNetwork.EPiSendMail.Plugin.ItemProviders +{ + public partial class RecipientProvider : System.Web.UI.UserControl, IEmailImporterProvider + { + public string ApiUrl = null; + private IEmailImporter _importer; + private IShowFeedback _feedbackCtrl; + + protected void Page_Load(object sender, EventArgs e) + { + // Do not do databind here - the container will do this for us + } + + protected override void OnDataBinding(EventArgs e) + { + base.OnDataBinding(e); + rptAddFromRecipientLists.DataSource = RecipientLists.ListAll(); + rptAddFromRecipientLists.DataBind(); + } + + public void Initialize(IEmailImporter importer, IShowFeedback feedbackUi) + { + // Depending on what we're adding addresses to, we need to call different controllers + string apiUrl = NewsLetterConfiguration.GetModuleBaseDir() + "/api/recipients/"; + int id = 0; + + if (importer is Job) + { + apiUrl = apiUrl + "AddRecipientsToJobFromList"; + id = ((Job)importer).Id; + apiUrl = apiUrl + "?jobId=" + id.ToString(); + } + else + { + // We're adding from a list to another listg + apiUrl = apiUrl + "AddRecipientsToListFromList"; + id = ((RecipientList)importer).Id; + apiUrl = apiUrl + "?destinationListId=" + id.ToString(); + } + + ApiUrl = apiUrl; + } + + + } +} \ No newline at end of file diff --git a/src/Newsletter/Plugin/WorkItemProviders/RecipientProvider.ascx.designer.cs b/src/Newsletter/Plugin/ItemProviders/RecipientProvider.ascx.designer.cs similarity index 92% rename from src/Newsletter/Plugin/WorkItemProviders/RecipientProvider.ascx.designer.cs rename to src/Newsletter/Plugin/ItemProviders/RecipientProvider.ascx.designer.cs index 1818300..e975701 100644 --- a/src/Newsletter/Plugin/WorkItemProviders/RecipientProvider.ascx.designer.cs +++ b/src/Newsletter/Plugin/ItemProviders/RecipientProvider.ascx.designer.cs @@ -7,7 +7,7 @@ // //------------------------------------------------------------------------------ -namespace BVNetwork.EPiSendMail.Plugin.WorkItemProviders { +namespace BVNetwork.EPiSendMail.Plugin.ItemProviders { public partial class RecipientProvider { diff --git a/src/Newsletter/Plugin/RecipientItemProviders/TextImportProvider.ascx b/src/Newsletter/Plugin/ItemProviders/TextImportProvider.ascx similarity index 73% rename from src/Newsletter/Plugin/RecipientItemProviders/TextImportProvider.ascx rename to src/Newsletter/Plugin/ItemProviders/TextImportProvider.ascx index 0d67a18..d3e55ca 100644 --- a/src/Newsletter/Plugin/RecipientItemProviders/TextImportProvider.ascx +++ b/src/Newsletter/Plugin/ItemProviders/TextImportProvider.ascx @@ -1,12 +1,12 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TextImportProvider.ascx.cs" Inherits="BVNetwork.EPiSendMail.Plugin.RecipientItemProviders.TextImportProvider" %> - +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TextImportProvider.ascx.cs" + Inherits="BVNetwork.EPiSendMail.Plugin.ItemProviders.TextImportProvider" %> Enter the email addresses you want to add:
- +
+ OnClick="cmdAddCsvEmailAddresses_Click" />
\ No newline at end of file diff --git a/src/Newsletter/Plugin/WorkItemProviders/TextImportProvider.ascx.cs b/src/Newsletter/Plugin/ItemProviders/TextImportProvider.ascx.cs similarity index 67% rename from src/Newsletter/Plugin/WorkItemProviders/TextImportProvider.ascx.cs rename to src/Newsletter/Plugin/ItemProviders/TextImportProvider.ascx.cs index f5a371b..9bf5798 100644 --- a/src/Newsletter/Plugin/WorkItemProviders/TextImportProvider.ascx.cs +++ b/src/Newsletter/Plugin/ItemProviders/TextImportProvider.ascx.cs @@ -1,30 +1,26 @@ using System; using System.Collections.Generic; using BVNetwork.EPiSendMail.DataAccess; +using BVNetwork.EPiSendMail.Plugin.ItemProviders; -namespace BVNetwork.EPiSendMail.Plugin.WorkItemProviders +namespace BVNetwork.EPiSendMail.Plugin.ItemProviders { - public partial class TextImportProvider : System.Web.UI.UserControl, IWorkItemProvider + public partial class TextImportProvider : System.Web.UI.UserControl, IEmailImporterProvider { - private Job _job; - private IJobUi _jobUi; + private IEmailImporter _importer; + private IShowFeedback _feedbackCtrl; protected void Page_Load(object sender, EventArgs e) { // Do not do databind here - the container will do this for us } - protected override void OnDataBinding(EventArgs e) - { - base.OnDataBinding(e); - } - protected void cmdAddCsvEmailAddresses_Click(object sender, EventArgs e) { string addresses = txtAddEmailWorkItems.Text; if (string.IsNullOrEmpty(addresses)) { - _jobUi.ShowError("Please enter email addresses to import."); + _feedbackCtrl.ShowError("Please enter email addresses to import."); return; } @@ -33,7 +29,7 @@ protected void cmdAddCsvEmailAddresses_Click(object sender, EventArgs e) List invalidAddresses; System.Diagnostics.Stopwatch tmr = System.Diagnostics.Stopwatch.StartNew(); - int count = _job.ImportEmailAddresses(addresses, out invalidAddresses, out duplicateAddresses); + int count = _importer.ImportEmailAddresses(addresses, out invalidAddresses, out duplicateAddresses); tmr.Stop(); string invalidMessage = ""; @@ -46,28 +42,24 @@ protected void cmdAddCsvEmailAddresses_Click(object sender, EventArgs e) } // Construct log message - string message = "Imported {0} email addresses
\n" + - "Number of duplicates: {2}
\n" + + string message = "Imported {0} email addresses
\n" + + "Number of duplicates: {2}
\n" + "Number of invalid addresses: {3}
\n" + "{4}"; - _jobUi.ShowInfo(string.Format(message, + _feedbackCtrl.ShowInfo(string.Format(message, count.ToString(), tmr.ElapsedMilliseconds.ToString(), duplicateAddresses.Count.ToString(), invalidAddresses.Count.ToString(), - invalidMessage + invalidMessage )); } - #region IWorkItemProvider Members - - public void Initialize(Job job, IJobUi jobUi) + public void Initialize(IEmailImporter importer, IShowFeedback feedbackUi) { - _job = job; - _jobUi = jobUi; + _importer = importer; + _feedbackCtrl = feedbackUi; } - - #endregion } } \ No newline at end of file diff --git a/src/Newsletter/Plugin/WorkItemProviders/TextImportProvider.ascx.designer.cs b/src/Newsletter/Plugin/ItemProviders/TextImportProvider.ascx.designer.cs similarity index 94% rename from src/Newsletter/Plugin/WorkItemProviders/TextImportProvider.ascx.designer.cs rename to src/Newsletter/Plugin/ItemProviders/TextImportProvider.ascx.designer.cs index 9672dd2..8cf6cdd 100644 --- a/src/Newsletter/Plugin/WorkItemProviders/TextImportProvider.ascx.designer.cs +++ b/src/Newsletter/Plugin/ItemProviders/TextImportProvider.ascx.designer.cs @@ -7,7 +7,7 @@ // //------------------------------------------------------------------------------ -namespace BVNetwork.EPiSendMail.Plugin.WorkItemProviders { +namespace BVNetwork.EPiSendMail.Plugin.ItemProviders { public partial class TextImportProvider { diff --git a/src/Newsletter/Plugin/RecipientItemProviders/EPiServerGroupProvider.ascx b/src/Newsletter/Plugin/RecipientItemProviders/EPiServerGroupProvider.ascx deleted file mode 100644 index d50cdf0..0000000 --- a/src/Newsletter/Plugin/RecipientItemProviders/EPiServerGroupProvider.ascx +++ /dev/null @@ -1,12 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EPiServerGroupProvider.ascx.cs" Inherits="BVNetwork.EPiSendMail.Plugin.RecipientItemProviders.EPiServerGroupProvider" %> - - - Select EPiServer group to add users as worker items: -
- -
- -
\ No newline at end of file diff --git a/src/Newsletter/Plugin/RecipientItemProviders/EPiServerGroupProvider.ascx.cs b/src/Newsletter/Plugin/RecipientItemProviders/EPiServerGroupProvider.ascx.cs deleted file mode 100644 index a92ee6a..0000000 --- a/src/Newsletter/Plugin/RecipientItemProviders/EPiServerGroupProvider.ascx.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web.Security; -using BVNetwork.EPiSendMail.DataAccess; - -namespace BVNetwork.EPiSendMail.Plugin.RecipientItemProviders -{ - public partial class EPiServerGroupProvider : System.Web.UI.UserControl, IRecipientItemProvider - { - private RecipientList _list; - private IRecipientListUi _listUi; - - protected void Page_Load(object sender, EventArgs e) - { - - } - - protected override void OnDataBinding(EventArgs e) - { - base.OnDataBinding(e); - LoadEPiGroups(); - } - - private void LoadEPiGroups() - { - if(Roles.Enabled) - { - if (dropListEPiGroups.Items.Count == 0) - { - // Fill it, but only first time - dropListEPiGroups.DataSource = Roles.GetAllRoles(); - dropListEPiGroups.DataBind(); - } - - } - } - - protected void cmdAddEPiGroupEmailAddresses_Click(object sender, EventArgs e) - { - List addresses = new List(); - - string selectedRoleName = dropListEPiGroups.SelectedValue; - string[] usersInRole = Roles.GetUsersInRole(selectedRoleName); - - foreach (string userName in usersInRole) - { - MembershipUser user = Membership.GetUser(userName); - if (user != null && string.IsNullOrEmpty(user.Email) == false) - addresses.Add(user.Email); - } - - if (addresses.Count == 0) - { - _listUi.ShowInfo("Could not find any email addresses "); - return; - } - - // Add the items - List duplicateAddresses; - List invalidAddresses; - - System.Diagnostics.Stopwatch tmr = System.Diagnostics.Stopwatch.StartNew(); - int count = _list.ImportEmailAddresses(addresses.ToArray(), out invalidAddresses, out duplicateAddresses); - tmr.Stop(); - - string invalidMessage = ""; - if (invalidAddresses.Count > 0) - { - // Show invalid addresses - invalidMessage = "
\n"; - invalidMessage += string.Join(", ", invalidAddresses.ToArray()); - invalidMessage += "
\n"; - } - - // Construct log message - string message = "Imported {0} email addresses from \"{1}\".
\n" + - "Number of duplicates: {2}
\n" + - "Number of invalid addresses: {3}
\n" + - "{4}"; - - _listUi.ShowInfo(string.Format(message, - count.ToString(), - selectedRoleName, - duplicateAddresses.Count.ToString(), - invalidAddresses.Count.ToString(), - invalidMessage - )); - } - - #region IRecipientItemProvider Members - - public void Initialize(BVNetwork.EPiSendMail.DataAccess.RecipientList list, IRecipientListUi listUi) - { - _list = list; - _listUi = listUi; - } - - #endregion - } -} \ No newline at end of file diff --git a/src/Newsletter/Plugin/RecipientItemProviders/EPiServerGroupProvider.ascx.designer.cs b/src/Newsletter/Plugin/RecipientItemProviders/EPiServerGroupProvider.ascx.designer.cs deleted file mode 100644 index b863fea..0000000 --- a/src/Newsletter/Plugin/RecipientItemProviders/EPiServerGroupProvider.ascx.designer.cs +++ /dev/null @@ -1,43 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.1433 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace BVNetwork.EPiSendMail.Plugin.RecipientItemProviders { - - - public partial class EPiServerGroupProvider { - - /// - /// Panel1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Panel Panel1; - - /// - /// dropListEPiGroups control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList dropListEPiGroups; - - /// - /// cmdAddEPiGroupEmailAddresses control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button cmdAddEPiGroupEmailAddresses; - } -} diff --git a/src/Newsletter/Plugin/RecipientItemProviders/IRecipientItemProvider.cs b/src/Newsletter/Plugin/RecipientItemProviders/IRecipientItemProvider.cs index 39fc525..5b7005d 100644 --- a/src/Newsletter/Plugin/RecipientItemProviders/IRecipientItemProvider.cs +++ b/src/Newsletter/Plugin/RecipientItemProviders/IRecipientItemProvider.cs @@ -7,7 +7,7 @@ public interface IRecipientItemProvider /// /// Initializes the provider with a recipient list. /// - void Initialize(RecipientList list, IRecipientListUi recipientListUi); + void Initialize(RecipientList list, IShowFeedback feedbackUi); } } diff --git a/src/Newsletter/Plugin/RecipientItemProviders/RecipientProvider.ascx b/src/Newsletter/Plugin/RecipientItemProviders/RecipientProvider.ascx deleted file mode 100644 index 59eabc4..0000000 --- a/src/Newsletter/Plugin/RecipientItemProviders/RecipientProvider.ascx +++ /dev/null @@ -1,31 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RecipientProvider.ascx.cs" Inherits="BVNetwork.EPiSendMail.Plugin.RecipientItemProviders.RecipientProvider" %> - -Select a Recipient List to add to this newsletter: -
- - - - - - - - - - - - - - - - - - - - - -
 NameTypeCountDescription
[]<%# Eval("Name") %><%# Eval("ListType") %><%# Eval("EmailAddressCount") %><%# Eval("Description") %>
- -
\ No newline at end of file diff --git a/src/Newsletter/Plugin/RecipientItemProviders/RecipientProvider.ascx.cs b/src/Newsletter/Plugin/RecipientItemProviders/RecipientProvider.ascx.cs deleted file mode 100644 index 65742c7..0000000 --- a/src/Newsletter/Plugin/RecipientItemProviders/RecipientProvider.ascx.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Web.UI.WebControls; -using BVNetwork.EPiSendMail.DataAccess; - -namespace BVNetwork.EPiSendMail.Plugin.RecipientItemProviders -{ - public partial class RecipientProvider : System.Web.UI.UserControl, IRecipientItemProvider - { - private RecipientList _list; - private IRecipientListUi _listUi; - - - protected void Page_Load(object sender, EventArgs e) - { - // Do not do databind here - the container will do this for us - } - - protected override void OnDataBinding(EventArgs e) - { - base.OnDataBinding(e); - rptAddFromRecipientLists.DataSource = RecipientLists.ListAll(); - rptAddFromRecipientLists.DataBind(); - } - - protected void cmdSelect_Click(object sender, CommandEventArgs e) - { - string recipListIdString = (string)e.CommandArgument; - int recipListId = int.Parse(recipListIdString); - RecipientList list = RecipientList.Load(recipListId); - - // Add the items - int count = _list.AddRecipientItemsFromRecipientList(recipListId); - _listUi.ShowInfo("Added " + count.ToString() + " Recipients from Recipient List " + list.Name); - - } - - #region IRecipientItemProvider Members - - public void Initialize(BVNetwork.EPiSendMail.DataAccess.RecipientList list, IRecipientListUi listUi) - { - _list = list; - _listUi = listUi; - } - - #endregion - } -} \ No newline at end of file diff --git a/src/Newsletter/Plugin/RecipientItemProviders/RecipientProvider.ascx.designer.cs b/src/Newsletter/Plugin/RecipientItemProviders/RecipientProvider.ascx.designer.cs deleted file mode 100644 index 45244fc..0000000 --- a/src/Newsletter/Plugin/RecipientItemProviders/RecipientProvider.ascx.designer.cs +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace BVNetwork.EPiSendMail.Plugin.RecipientItemProviders { - - - public partial class RecipientProvider { - - /// - /// rptAddFromRecipientLists control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Repeater rptAddFromRecipientLists; - } -} diff --git a/src/Newsletter/Plugin/RecipientItemProviders/TextImportProvider.ascx.cs b/src/Newsletter/Plugin/RecipientItemProviders/TextImportProvider.ascx.cs deleted file mode 100644 index d6e7b3f..0000000 --- a/src/Newsletter/Plugin/RecipientItemProviders/TextImportProvider.ascx.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Collections.Generic; -using BVNetwork.EPiSendMail.DataAccess; - -namespace BVNetwork.EPiSendMail.Plugin.RecipientItemProviders -{ - public partial class TextImportProvider : System.Web.UI.UserControl, IRecipientItemProvider - { - private static RecipientList _list; - private static IRecipientListUi _listUi; - - - protected void Page_Load(object sender, EventArgs e) - { - // Do not do databind here - the container will do this for us - } - - protected override void OnDataBinding(EventArgs e) - { - base.OnDataBinding(e); - } - - protected void cmdAddCsvEmailAddresses_Click(object sender, EventArgs e) - { - string addresses = txtAddEmailWorkItems.Text; - if (string.IsNullOrEmpty(addresses)) - { - _listUi.ShowError("Please enter email addresses to import."); - return; - } - - // Add the items - List duplicateAddresses; - List invalidAddresses; - - System.Diagnostics.Stopwatch tmr = System.Diagnostics.Stopwatch.StartNew(); - int count = _list.ImportEmailAddresses(addresses, out invalidAddresses, out duplicateAddresses); - tmr.Stop(); - - string invalidMessage = ""; - if (invalidAddresses.Count > 0) - { - // Show invalid addresses - invalidMessage = "
\n"; - invalidMessage += string.Join(", ", invalidAddresses.ToArray()); - invalidMessage += "
\n"; - } - - // Construct log message - string message = "Imported {0} email addresses
\n" + - "Number of duplicates: {2}
\n" + - "Number of invalid addresses: {3}
\n" + - "{4}"; - - _listUi.ShowInfo(string.Format(message, - count.ToString(), - tmr.ElapsedMilliseconds.ToString(), - duplicateAddresses.Count.ToString(), - invalidAddresses.Count.ToString(), - invalidMessage - )); - } - - #region IRecipientItemProvider Members - - public void Initialize(BVNetwork.EPiSendMail.DataAccess.RecipientList list, IRecipientListUi listUi) - { - _list = list; - _listUi = listUi; - } - - #endregion - - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - } - - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - cmdAddCsvEmailAddresses.Click += new EventHandler(cmdAddCsvEmailAddresses_Click); - } - } -} \ No newline at end of file diff --git a/src/Newsletter/Plugin/RecipientItemProviders/TextImportProvider.ascx.designer.cs b/src/Newsletter/Plugin/RecipientItemProviders/TextImportProvider.ascx.designer.cs deleted file mode 100644 index b6f6d6e..0000000 --- a/src/Newsletter/Plugin/RecipientItemProviders/TextImportProvider.ascx.designer.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace BVNetwork.EPiSendMail.Plugin.RecipientItemProviders { - - - public partial class TextImportProvider { - - /// - /// txtAddEmailWorkItems control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtAddEmailWorkItems; - - /// - /// cmdAddCsvEmailAddresses control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button cmdAddCsvEmailAddresses; - } -} diff --git a/src/Newsletter/Plugin/RecipientLists/AddRecipients.ascx.cs b/src/Newsletter/Plugin/RecipientLists/AddRecipients.ascx.cs index 34e19c4..98830b0 100644 --- a/src/Newsletter/Plugin/RecipientLists/AddRecipients.ascx.cs +++ b/src/Newsletter/Plugin/RecipientLists/AddRecipients.ascx.cs @@ -4,6 +4,7 @@ using System.Web.UI; using System.Web.UI.WebControls; using BVNetwork.EPiSendMail.Configuration; +using BVNetwork.EPiSendMail.Plugin.ItemProviders; using BVNetwork.EPiSendMail.Plugin.RecipientItemProviders; namespace BVNetwork.EPiSendMail.Plugin @@ -12,35 +13,13 @@ public partial class AddRecipients : RecipientListUiUserControlBase { const string PROVIDER_SUFFIX = "Provider"; private Dictionary _providerCtrls = new Dictionary(); - private List _recipientProviders = new List(); + private List _recipientProviders = null; protected override void OnInit(EventArgs e) { base.OnInit(e); - _recipientProviders.Add(new RecipientListProviderDescriptor( - "RecipientList", - "Add from one of your Recipient Lists", - BVNetwork.EPiSendMail.Configuration.NewsLetterConfiguration.GetModuleBaseDir() + "/plugin/recipientitemproviders/recipientprovider.ascx" - )); - - _recipientProviders.Add(new RecipientListProviderDescriptor( - "TextImport", - "Import from text", - BVNetwork.EPiSendMail.Configuration.NewsLetterConfiguration.GetModuleBaseDir() + "/plugin/recipientitemproviders/TextImportProvider.ascx" - )); - - _recipientProviders.Add(new RecipientListProviderDescriptor( - "EPiServerGroup", - "Add email addresses from an EPiServer Group", - BVNetwork.EPiSendMail.Configuration.NewsLetterConfiguration.GetModuleBaseDir() + "/plugin/recipientitemproviders/EPiServerGroupProvider.ascx" - )); - - _recipientProviders.Add(new RecipientListProviderDescriptor( - "CommerceUsers", - "Add email addresses from an EPiServer Group", - BVNetwork.EPiSendMail.Configuration.NewsLetterConfiguration.GetModuleBaseDir() + "/plugin/recipientitemproviders/CommerceUsersProvider.ascx" - )); + _recipientProviders = NewsLetterConfiguration.GetRecipientListProviderDescriptors(); foreach (RecipientListProviderDescriptor descriptor in _recipientProviders) { @@ -51,9 +30,13 @@ protected override void OnInit(EventArgs e) ctrl.ID = descriptor.ProviderName + PROVIDER_SUFFIX; _providerCtrls.Add(descriptor.ProviderName, ctrl); pnlProviderContainer.Controls.Add(ctrl); + + // Initialize the provider, needs to be done this + // early, or post backs won't work + ((IEmailImporterProvider)ctrl).Initialize(RecipientList, RecipientListBase); + } } - } protected void Page_Load(object sender, EventArgs e) @@ -80,7 +63,7 @@ public void ShowRecipientItemProvider() pnlProviderUiContainer.Visible = true; // Initialize provider - ((IRecipientItemProvider)ctrl).Initialize(RecipientList, RecipientListBase); + ((IEmailImporterProvider)ctrl).Initialize(RecipientList, RecipientListBase); // Databind it, to have it load it's values ctrl.DataBind(); diff --git a/src/Newsletter/Plugin/RecipientLists/IRecipientListUi.cs b/src/Newsletter/Plugin/RecipientLists/IRecipientListUi.cs index 7f85b62..4685874 100644 --- a/src/Newsletter/Plugin/RecipientLists/IRecipientListUi.cs +++ b/src/Newsletter/Plugin/RecipientLists/IRecipientListUi.cs @@ -2,6 +2,21 @@ namespace BVNetwork.EPiSendMail.Plugin { + public interface IShowFeedback + { + /// + /// Shows an error message on the page. + /// + /// Error message. + void ShowError(string message); + + /// + /// Shows an info message on the page. + /// + /// The info message. + void ShowInfo(string message); + } + public interface IRecipientListUi { /// @@ -21,17 +36,5 @@ int RecipientListId { get; } - - /// - /// Shows an error message on the page. - /// - /// Error message. - void ShowError(string message); - - /// - /// Shows an info message on the page. - /// - /// The info message. - void ShowInfo(string message); } } diff --git a/src/Newsletter/Plugin/RecipientLists/ListEdit.aspx b/src/Newsletter/Plugin/RecipientLists/ListEdit.aspx index dec916a..708cfdf 100644 --- a/src/Newsletter/Plugin/RecipientLists/ListEdit.aspx +++ b/src/Newsletter/Plugin/RecipientLists/ListEdit.aspx @@ -1,4 +1,5 @@ <%@ Page Language="c#" EnableViewState="true" CodeBehind="ListEdit.aspx.cs" AutoEventWireup="True" Inherits="BVNetwork.EPiSendMail.Plugin.RecipientListEdit" %> +<%@ Import Namespace="BVNetwork.EPiSendMail.Configuration" %> <%@ Register TagPrefix="EPiSendMail" TagName="StatusMessage" Src="../StatusMessage.ascx" %> <%@ Register TagPrefix="EPiSendMail" TagName="AddRecipients" Src="../RecipientLists/AddRecipients.ascx" %> @@ -9,6 +10,24 @@ + @@ -39,7 +58,7 @@ <%-- Status of list --%>

Number of addresses: - +

Actions <%-- This link will get it's href from code --%> diff --git a/src/Newsletter/Plugin/RecipientLists/RecipientListUiPageBase.cs b/src/Newsletter/Plugin/RecipientLists/RecipientListUiPageBase.cs index ca2790a..7ee98cd 100644 --- a/src/Newsletter/Plugin/RecipientLists/RecipientListUiPageBase.cs +++ b/src/Newsletter/Plugin/RecipientLists/RecipientListUiPageBase.cs @@ -3,7 +3,7 @@ namespace BVNetwork.EPiSendMail.Plugin { - public class RecipientListUiPageBase : PluginWebFormsBase, IRecipientListUi + public class RecipientListUiPageBase : PluginWebFormsBase, IRecipientListUi, IShowFeedback { private RecipientList _recipientList; private int _recipientListId = -1; diff --git a/src/Newsletter/Plugin/RecipientLists/RecipientListUiUserControlBase.cs b/src/Newsletter/Plugin/RecipientLists/RecipientListUiUserControlBase.cs index 3359001..4c640e8 100644 --- a/src/Newsletter/Plugin/RecipientLists/RecipientListUiUserControlBase.cs +++ b/src/Newsletter/Plugin/RecipientLists/RecipientListUiUserControlBase.cs @@ -3,13 +3,13 @@ namespace BVNetwork.EPiSendMail.Plugin { - public class RecipientListUiUserControlBase : EPiServer.UserControlBase, IRecipientListUi + public class RecipientListUiUserControlBase : EPiServer.UserControlBase, IRecipientListUi, IShowFeedback { public RecipientListUiPageBase RecipientListBase { get { - return this.Page as RecipientListUiPageBase; ; + return this.Page as RecipientListUiPageBase; } } diff --git a/src/Newsletter/Plugin/WorkItemProviders/EPiServerGroupProvider.ascx.cs b/src/Newsletter/Plugin/WorkItemProviders/EPiServerGroupProvider.ascx.cs deleted file mode 100644 index 9f3daf4..0000000 --- a/src/Newsletter/Plugin/WorkItemProviders/EPiServerGroupProvider.ascx.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web.Security; -using BVNetwork.EPiSendMail.Api.Models; -using BVNetwork.EPiSendMail.DataAccess; -using BVNetwork.EPiSendMail.Library; - -namespace BVNetwork.EPiSendMail.Plugin.WorkItemProviders -{ - public partial class EPiServerGroupProvider : JobUiUserControlBase, IWorkItemProvider - { - - protected override void OnDataBinding(EventArgs e) - { - base.OnDataBinding(e); - LoadEPiGroups(); - } - - private void LoadEPiGroups() - { - if (dropListEPiGroups.Items.Count == 0) - { - // Fill it, but only first time - dropListEPiGroups.DataSource = Roles.GetAllRoles(); - dropListEPiGroups.DataBind(); - } - } - - public RecipientStatus AddEPiServerGroupRecipients(int jobId,string groupName) - { - Job _job = Job.Load(jobId); - RecipientStatus status = new RecipientStatus(); - - List addresses = new List(); - string[] usersInRole = Roles.GetUsersInRole(groupName); - - foreach (string userName in usersInRole) - { - MembershipUser user = Membership.GetUser(userName); - if (user != null && string.IsNullOrEmpty(user.Email) == false) - addresses.Add(user.Email); - } - - if (addresses.Count == 0) - { - status.Status = "Could not find any email addresses for users in the EPiServer group."; - return status; - } - - // Add the items - List duplicateAddresses; - List invalidAddresses; - - System.Diagnostics.Stopwatch tmr = System.Diagnostics.Stopwatch.StartNew(); - int count = _job.ImportEmailAddresses(addresses.ToArray(), out invalidAddresses, out duplicateAddresses); - tmr.Stop(); - - if (invalidAddresses.Count > 0) - { - status.InvalidMessage = string.Join(", ", invalidAddresses.ToArray()); - } - - status.ImportedEmails = count; - status.DuplicatedEmails = duplicateAddresses.Count; - status.InvalidEmails = invalidAddresses.Count; - status.TimeToImport = tmr.ElapsedMilliseconds; - status.Status = "Import ok"; - - return status; - } - - - public void Initialize(Job job, IJobUi jobUi) - { - // No need for Job and IJobUI when doing ajax calls. - //throw new NotImplementedException(); - } - } - -} \ No newline at end of file diff --git a/src/Newsletter/Plugin/WorkItemProviders/RecipientProvider.ascx b/src/Newsletter/Plugin/WorkItemProviders/RecipientProvider.ascx deleted file mode 100644 index 3ad82cf..0000000 --- a/src/Newsletter/Plugin/WorkItemProviders/RecipientProvider.ascx +++ /dev/null @@ -1,33 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RecipientProvider.ascx.cs" Inherits="BVNetwork.EPiSendMail.Plugin.WorkItemProviders.RecipientProvider" %> - -Select a Recipient List: -
- - -
- - - - - - - - - - - - - - - - - - - -
 NameTypeCountDescription
<%# Eval("Name") %><%# Eval("ListType") %><%# Eval("EmailAddressCount") %><%# Eval("Description") %>
-
- -
\ No newline at end of file diff --git a/src/Newsletter/Plugin/WorkItemProviders/RecipientProvider.ascx.cs b/src/Newsletter/Plugin/WorkItemProviders/RecipientProvider.ascx.cs deleted file mode 100644 index 91b02d2..0000000 --- a/src/Newsletter/Plugin/WorkItemProviders/RecipientProvider.ascx.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Web.UI.WebControls; -using BVNetwork.EPiSendMail.DataAccess; - -namespace BVNetwork.EPiSendMail.Plugin.WorkItemProviders -{ - public partial class RecipientProvider : System.Web.UI.UserControl, IWorkItemProvider - { - private Job _job; - private IJobUi _jobUi; - - protected void Page_Load(object sender, EventArgs e) - { - // Do not do databind here - the container will do this for us - } - - protected override void OnDataBinding(EventArgs e) - { - base.OnDataBinding(e); - rptAddFromRecipientLists.DataSource = RecipientLists.ListAll(); - rptAddFromRecipientLists.DataBind(); - } - - protected void cmdSelect_Click(object sender, CommandEventArgs e) - { - string recipListIdString = (string)e.CommandArgument; - int recipListId = int.Parse(recipListIdString); - RecipientList list = RecipientList.Load(recipListId); - - // Add the items - int count = _job.AddWorkItemsFromRecipientList(recipListId); - _jobUi.ShowInfo("Added " + count.ToString() + " Recipients from Recipient List " + list.Name); - - } - - #region IWorkItemProvider Members - - public void Initialize(BVNetwork.EPiSendMail.DataAccess.Job job, IJobUi jobUi) - { - _job = job; - _jobUi = jobUi; - } - - #endregion - } -} \ No newline at end of file diff --git a/src/Newsletter/Plugin/WorkItemProviders/TextImportProvider.ascx b/src/Newsletter/Plugin/WorkItemProviders/TextImportProvider.ascx deleted file mode 100644 index ecc972a..0000000 --- a/src/Newsletter/Plugin/WorkItemProviders/TextImportProvider.ascx +++ /dev/null @@ -1,12 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TextImportProvider.ascx.cs" - Inherits="BVNetwork.EPiSendMail.Plugin.WorkItemProviders.TextImportProvider" %> - - - Enter the email addresses you want to add: -
- -
- -
\ No newline at end of file diff --git a/src/_Newsletter.Configuration/ConfigurationSection.csd b/src/_Newsletter.Configuration/ConfigurationSection.csd new file mode 100644 index 0000000..ab95745 --- /dev/null +++ b/src/_Newsletter.Configuration/ConfigurationSection.csd @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/_Newsletter.Configuration/ConfigurationSection.csd.config b/src/_Newsletter.Configuration/ConfigurationSection.csd.config new file mode 100644 index 0000000..4b8b12e --- /dev/null +++ b/src/_Newsletter.Configuration/ConfigurationSection.csd.config @@ -0,0 +1,24 @@ + + + + +
+ + + + + diff --git a/src/_Newsletter.Configuration/ConfigurationSection.csd.cs b/src/_Newsletter.Configuration/ConfigurationSection.csd.cs new file mode 100644 index 0000000..5145ec3 --- /dev/null +++ b/src/_Newsletter.Configuration/ConfigurationSection.csd.cs @@ -0,0 +1,405 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34209 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace BVNetwork.EPiSendMail.Configuration +{ + + + /// + /// The Newsletter Configuration Section. + /// + public partial class Newsletter : global::System.Configuration.ConfigurationSection + { + + #region Singleton Instance + /// + /// The XML name of the Newsletter Configuration Section. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string NewsletterSectionName = "newsletter"; + + /// + /// The XML path of the Newsletter Configuration Section. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string NewsletterSectionPath = "newsletter"; + + /// + /// Gets the Newsletter instance. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public static global::BVNetwork.EPiSendMail.Configuration.Newsletter Instance + { + get + { + return ((global::BVNetwork.EPiSendMail.Configuration.Newsletter)(global::System.Configuration.ConfigurationManager.GetSection(global::BVNetwork.EPiSendMail.Configuration.Newsletter.NewsletterSectionPath))); + } + } + #endregion + + #region Xmlns Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string XmlnsPropertyName = "xmlns"; + + /// + /// Gets the XML namespace of this Configuration Section. + /// + /// + /// This property makes sure that if the configuration file contains the XML namespace, + /// the parser doesn't throw an exception because it encounters the unknown "xmlns" attribute. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.Newsletter.XmlnsPropertyName, IsRequired=false, IsKey=false, IsDefaultCollection=false)] + public string Xmlns + { + get + { + return ((string)(base[global::BVNetwork.EPiSendMail.Configuration.Newsletter.XmlnsPropertyName])); + } + } + #endregion + + #region IsReadOnly override + /// + /// Gets a value indicating whether the element is read-only. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public override bool IsReadOnly() + { + return false; + } + #endregion + + #region SenderType Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string SenderTypePropertyName = "senderType"; + + /// + /// Gets or sets the SenderType. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.ComponentModel.DescriptionAttribute("The SenderType.")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.Newsletter.SenderTypePropertyName, IsRequired=false, IsKey=false, IsDefaultCollection=false)] + public virtual string SenderType + { + get + { + return ((string)(base[global::BVNetwork.EPiSendMail.Configuration.Newsletter.SenderTypePropertyName])); + } + set + { + base[global::BVNetwork.EPiSendMail.Configuration.Newsletter.SenderTypePropertyName] = value; + } + } + #endregion + + #region RecipientListProviders Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string RecipientListProvidersPropertyName = "recipientListProviders"; + + /// + /// Gets or sets the RecipientListProviders. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.ComponentModel.DescriptionAttribute("The RecipientListProviders.")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.Newsletter.RecipientListProvidersPropertyName, IsRequired=false, IsKey=false, IsDefaultCollection=false)] + public virtual global::BVNetwork.EPiSendMail.Configuration.RecipientListProviders RecipientListProviders + { + get + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProviders)(base[global::BVNetwork.EPiSendMail.Configuration.Newsletter.RecipientListProvidersPropertyName])); + } + set + { + base[global::BVNetwork.EPiSendMail.Configuration.Newsletter.RecipientListProvidersPropertyName] = value; + } + } + #endregion + } +} +namespace BVNetwork.EPiSendMail.Configuration +{ + + + /// + /// A collection of RecipientListProvider instances. + /// + [global::System.Configuration.ConfigurationCollectionAttribute(typeof(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider), CollectionType=global::System.Configuration.ConfigurationElementCollectionType.AddRemoveClearMap, AddItemName="add", RemoveItemName="remove", ClearItemsName="clear")] + public partial class RecipientListProviders : global::System.Configuration.ConfigurationElementCollection + { + + #region Constants + /// + /// The XML name of the individual instances in this collection. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string RecipientListProviderPropertyName = "recipientListProvider"; + #endregion + + #region Overrides + /// + /// Gets the type of the . + /// + /// The of this collection. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public override global::System.Configuration.ConfigurationElementCollectionType CollectionType + { + get + { + return global::System.Configuration.ConfigurationElementCollectionType.AddRemoveClearMap; + } + } + + /// + /// Gets the name used to identify this collection of elements + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + protected override string ElementName + { + get + { + return global::BVNetwork.EPiSendMail.Configuration.RecipientListProviders.RecipientListProviderPropertyName; + } + } + + /// + /// Indicates whether the specified exists in the . + /// + /// The name of the element to verify. + /// + /// if the element exists in the collection; otherwise, . + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + protected override bool IsElementName(string elementName) + { + return (elementName == global::BVNetwork.EPiSendMail.Configuration.RecipientListProviders.RecipientListProviderPropertyName); + } + + /// + /// Gets the element key for the specified configuration element. + /// + /// The to return the key for. + /// + /// An that acts as the key for the specified . + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + protected override object GetElementKey(global::System.Configuration.ConfigurationElement element) + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider)(element)).Name; + } + + /// + /// Creates a new . + /// + /// + /// A new . + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + protected override global::System.Configuration.ConfigurationElement CreateNewElement() + { + return new global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider(); + } + #endregion + + #region Indexer + /// + /// Gets the at the specified index. + /// + /// The index of the to retrieve. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider this[int index] + { + get + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider)(base.BaseGet(index))); + } + } + + /// + /// Gets the with the specified key. + /// + /// The key of the to retrieve. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider this[object name] + { + get + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider)(base.BaseGet(name))); + } + } + #endregion + + #region Add + /// + /// Adds the specified to the . + /// + /// The to add. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public void Add(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider recipientListProvider) + { + base.BaseAdd(recipientListProvider); + } + #endregion + + #region Remove + /// + /// Removes the specified from the . + /// + /// The to remove. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public void Remove(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider recipientListProvider) + { + base.BaseRemove(this.GetElementKey(recipientListProvider)); + } + #endregion + + #region GetItem + /// + /// Gets the at the specified index. + /// + /// The index of the to retrieve. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider GetItemAt(int index) + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider)(base.BaseGet(index))); + } + + /// + /// Gets the with the specified key. + /// + /// The key of the to retrieve. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider GetItemByKey(string name) + { + return ((global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider)(base.BaseGet(((object)(name))))); + } + #endregion + + #region IsReadOnly override + /// + /// Gets a value indicating whether the element is read-only. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public override bool IsReadOnly() + { + return false; + } + #endregion + } +} +namespace BVNetwork.EPiSendMail.Configuration +{ + + + /// + /// The RecipientListProvider Configuration Element. + /// + public partial class RecipientListProvider : global::System.Configuration.ConfigurationElement + { + + #region IsReadOnly override + /// + /// Gets a value indicating whether the element is read-only. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + public override bool IsReadOnly() + { + return false; + } + #endregion + + #region Name Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string NamePropertyName = "name"; + + /// + /// Gets or sets the Name. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.ComponentModel.DescriptionAttribute("The Name.")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.NamePropertyName, IsRequired=true, IsKey=true, IsDefaultCollection=false)] + public virtual string Name + { + get + { + return ((string)(base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.NamePropertyName])); + } + set + { + base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.NamePropertyName] = value; + } + } + #endregion + + #region DisplayName Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string DisplayNamePropertyName = "displayName"; + + /// + /// Gets or sets the DisplayName. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.ComponentModel.DescriptionAttribute("The DisplayName.")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.DisplayNamePropertyName, IsRequired=true, IsKey=false, IsDefaultCollection=false)] + public virtual string DisplayName + { + get + { + return ((string)(base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.DisplayNamePropertyName])); + } + set + { + base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.DisplayNamePropertyName] = value; + } + } + #endregion + + #region Url Property + /// + /// The XML name of the property. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + internal const string UrlPropertyName = "url"; + + /// + /// Gets or sets the Url. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ConfigurationSectionDesigner.CsdFileGenerator", "2.0.1.7")] + [global::System.ComponentModel.DescriptionAttribute("The Url.")] + [global::System.Configuration.ConfigurationPropertyAttribute(global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.UrlPropertyName, IsRequired=true, IsKey=false, IsDefaultCollection=false)] + public virtual string Url + { + get + { + return ((string)(base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.UrlPropertyName])); + } + set + { + base[global::BVNetwork.EPiSendMail.Configuration.RecipientListProvider.UrlPropertyName] = value; + } + } + #endregion + } +} diff --git a/src/_Newsletter.Configuration/ConfigurationSection.csd.diagram b/src/_Newsletter.Configuration/ConfigurationSection.csd.diagram new file mode 100644 index 0000000..e69de29 diff --git a/src/_Newsletter.Configuration/ConfigurationSection.csd.xsd b/src/_Newsletter.Configuration/ConfigurationSection.csd.xsd new file mode 100644 index 0000000..009b8ee --- /dev/null +++ b/src/_Newsletter.Configuration/ConfigurationSection.csd.xsd @@ -0,0 +1,62 @@ + + + + + + + + + The RecipientListProviders. + + + + + + The SenderType. + + + + + + + + + + The RecipientListProvider Configuration Element. + + + + + + + + The Name. + + + + + + + + The Name. + + + + + The DisplayName. + + + + + The Url. + + + + diff --git a/src/_Newsletter.Configuration/EPiCode.Newsletter.Configuration.csproj b/src/_Newsletter.Configuration/EPiCode.Newsletter.Configuration.csproj new file mode 100644 index 0000000..8c67d35 --- /dev/null +++ b/src/_Newsletter.Configuration/EPiCode.Newsletter.Configuration.csproj @@ -0,0 +1,75 @@ + + + + Debug + AnyCPU + 10.0.20723 + 2.0 + {495118BF-965F-41B3-8077-4A1D789FCE51} + Library + Properties + BVNetwork.EPiSendMail.Configuration + BVNetwork.EPiSendMail.Configuration + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + True + True + ConfigurationSection.csd + + + + + + CsdFileGenerator + ConfigurationSection.csd.cs + + + ConfigurationSection.csd + + + ConfigurationSection.csd + + + ConfigurationSection.csd + Designer + + + + + + + + + \ No newline at end of file diff --git a/src/_Newsletter.Configuration/Newsletter.Configuration.csproj b/src/_Newsletter.Configuration/Newsletter.Configuration.csproj new file mode 100644 index 0000000..cd37be5 --- /dev/null +++ b/src/_Newsletter.Configuration/Newsletter.Configuration.csproj @@ -0,0 +1,61 @@ + + + + Debug + AnyCPU + 10.0.20723 + 2.0 + {58A100CE-CC7E-43BF-A054-D28648F092AC} + Library + Properties + Newsletter.Configuration + Newsletter.Configuration + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + CsdFileGenerator + + + ConfigurationSection.csd + + + + + + + + \ No newline at end of file diff --git a/src/_Newsletter.Configuration/Properties/AssemblyInfo.cs b/src/_Newsletter.Configuration/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..5451d5f --- /dev/null +++ b/src/_Newsletter.Configuration/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Newsletter.Configuration")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Newsletter.Configuration")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("991bc92a-ea4a-49c0-9e32-b554ad51a8ea")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")]