# Unsubscribe form widget

You use the *Unsubscribe form* widget to give users the option to unsubscribe from an email campaign or the mailing list they are part of. Users can unsubscribe through a dedicated link.

> info  **PREREQUISITES**: You created at least one mailing list, to which visitors can subscribe and unsubscribe. For more information, see [Create mailing lists](https://www.progress.com/documentation/sitefinity-cms/create-mailing-lists).

After you place the *Unsubscribe form* widget on your page, you configure it to display the unsubscribe form. To do this, click *Edit* button in the upper-right corner of the widget. To enable users to unsubscribe from a newsletter, in the *Unsubscribe* dialogue, set the following:

1. Define how users can unsubscribe:
   * Through a link (included in newsletter):
     1. In the text editor, enter the text displayed when a user unsubscribes from an email campaign.
     2. Use *Insert dynamic data* in the text dropdown box to insert different placeholders in your email campaign message, such as the name and the email of the subscriber or different properties of the mailing list. For example, your message can start like this *Dear {|Subscriber.FirstName|}, you have successfully unsubscribed from our monthly newsletter.* The message can look similar to this: *Dear John, you have successfully unsubscribed from our monthly newsletter.*
   * Email address\
     Select the mailing list from which the user will be unsubscribed:
     1. From the list, select one mailing list and click *Done selecting*.
     2. Define what you want the system to display when the form is submitted successfully:
        * *Show message*\
          This is the default option.
        * To open another page after successful subscription, select *Open a specially prepared page...*. Select a page.
2. In the *Template* section, select the template you want to use.\
   All *Unsubscribe form* widget templates created from the backend and in file system are listed in *Template* dropdown.

   > info  **NOTE**: You can optionally customize the default widget template or create a new template for the Unsubscribe form widget. For more information, see [Overview: Widget templates](https://www.progress.com/documentation/sitefinity-cms/overview-widget-templates-mvc).
3. Expand the *More options* section to specify CSS file names and apply additional CSS classes to the Unsubscribe form widget.
4. When you are finished with all the settings, click *Save*.

Next, you set mailing lists and email campaigns users can unsubscribe from:

1. In the mail menu, click *Marketing » Mailing lists*.
2. Click the *Actions* menu of the mailing list where you want to display an unsubscribe link.
3. From the dropdown menu, select *Properties* and expand *Mail settings*.
4. Under *Unsubscribe page*, click *Select a page*.\
   Select the page where you have dropped the *Unsubscribe form* widget and click *Done*.
5. Save your changes.
6. Open the text of the campaign issue where you want to display the unsubscribe link.\
   Click *Marketing* »*Campaigns* »*< Campaign name >* »*< Issue name >*.
7. In the text of the issue, enter `{|MergeContextItems.UnsubscribeLink|}` where you want to display the link.
8. Save your changes.

As a result, if you selected the *Link(included in newsletter)* option, when users receive the issue and click the link, the system automatically unsubscribes these users from the campaign and displays the message you defined. If you selected *Email address*, users can be unsubscribed from the mailing list by their email addresses.

### Model settings

Model settings display all properties directly bound to the *Unsubscribe form* widget model. Access these properties by clicking the *Model* button in *Advanced* settings.

* *WidgetTitle*\
  Gets or sets the title of the widget displayed in the template when you selected *EmailAddress* unsubscribe mode.
* *WidgetDescription*\
  Gets or sets the description of the widget displayed in the template when you selected *EmailAddress* unsubscribe mode.
