docs/en/modules/cms-kit-pro/newsletter.md
//[doc-seo]
{
"Description": "Discover how to enable and manage the newsletter system in CMS Kit Pro, enhancing user engagement with subscription features."
}
You must have an ABP Team or a higher license to use CMS Kit Pro module's features.
CMS Kit provides a newsletter system to allow users to subscribe to newsletters. Here a screenshot of the newsletter subscription widget:
By default, CMS Kit features are disabled. Therefore, you need to enable the features you want, before starting to use it. You can use the Global Feature system to enable/disable CMS Kit features on development time. Alternatively, you can use the ABP's Feature System to disable a CMS Kit feature on runtime.
Check the "How to Install" section of the CMS Kit Module documentation to see how to enable/disable CMS Kit features on development time.
Newsletters: Opens the newsletter subscription management page.
You can then view the subscribers and export the list as CSV file, in the admin side of your solution:
You (and users of your public web application) can manage your email preferences and unsubscribe from newsletters by visiting the Email Preferences page (/cms/newsletter/email-preferences), in the public side of your solution:
The newsletter subscription system provides a newsletter subscription widget to allow users to subscribe to a newsletter. You can simply place the widget on a page like below:
@await Component.InvokeAsync(
typeof(NewsletterViewComponent),
new
{
preference = "TechNewsletter",
source = "Footer",
requestAdditionalPreferencesLater = false
})
When you're adding the newsletter component, you can the specify source parameter to see where users subscribe to newsletters. See the options to understand the preferences.
Before using the newsletter system, you need to define the preferences. You can use the NewsletterOptions type to define preferences. NewsletterOptions can be configured in the domain layer, in the ConfigureServices method of your module.
Example:
options.AddPreference("TechNewsletter",
new NewsletterPreferenceDefinition(
"Daily Technology Newsletter",
privacyPolicyConfirmation: "I accept the <a href='/privacy-policy'>Privacy Policy</a>.")
)
);
NewsletterOptions properties:
Preferences: List of defined newsletter preferences (NewsletterPreferenceDefinition) in the newsletter system.WidgetViewPath: Default view path for all newsletter preferences.NewsletterPreferenceDefinition properties:
Preference: Name of the preference. We will use this field while displaying the newsletter component on the UI.PrivacyPolicyConfirmation: Privacy policy confirmation text shown in the newsletter subscription widget.AdditionalPreferences: Additional preference list that will show up after a user subscribes to the newsletter.WidgetPath: If you want to use a different newsletter widget instead of the default widget, you can specify the newsletter widget path using this field.This module follows the Entity Best Practices & Conventions guide.
A newsletter record represents a newsletter subscription for a specific email address
NewsletterRecord (aggregate root): Represents a newsletter subscription in the system.This module follows the Repository Best Practices & Conventions guide.
Following custom repositories are defined for this feature:
INewsletterRecordRepositoryThis module follows the Domain Services Best Practices & Conventions guide.
NewsletterRecordManager is used to perform some operations for the NewsletterRecord aggregate root.
NewsletterRecordAdminAppService (implements INewsletterRecordAdminAppService): Implements the use cases of newsletter subscription management.NewsletterRecordPublicAppService (implements INewsletterRecordPublicAppService): Implements the use cases of newsletter subscription for public websites.All tables/collections use the Cms prefix by default. Set static properties on the CmsKitDbProperties class if you need to change the table prefix or set a schema name (if supported by your database provider).
This module uses CmsKit for the connection string name. If you don't define a connection string with this name, it fallbacks to the Default connection string.
See the connection strings documentation for details.
Check the "Entity Extensions" section of the CMS Kit Module documentation to see how to extend entities of the Newsletter Feature of the CMS Kit Pro module.