When used on a Content Studio document it provides visitors with a list of their current newsletter subscriptions and offers the possibility to remove them (unsubscribe). This control only handles subscribers stored in the built in subscriber repository.
Background
The document author must provide a way of collection the visitor's email address that must be set before this control works. The address can be stored in a cookie after that the subscriber has logged in and set to the control in the Page_Load event. The control also offers the possibility to validate the action through a conformation mail or the selected subscriptions can be removed directly.
Using confirmation messages
The control has a built in support for mail base confirmation of removals. It works by sending a specially crafted mail to the subscriber. Content Studio cannot send out mail until the mail settings have been configured in Web.config. This includes the name of the Mail server to use and the optional authentication credentials and method to use. Remember, not all mail server are configured to allow anonymous sending of mail messages.
The following code example specifies the appropriate SMTP parameters to send e-mail using the default network credentials using an SMTP server named POSTMAN.
<configuration>
<!--Other setting elements might exist -->
<system.net>
<mailSettings>
<smtp deliveryMethod="network">
<network
host="POSTMAN"
port="25"
defaultCredentials="true"
/>
</smtp>
</mailSettings>
</system.net>
<!--Other configuration elements might exist -->
</configuration>
Examples
When placed on a Content Studio document the SubscriptionRemover control can look something like this
- Remove your subscriptions
- Select the subscriptions you would like to remove and press the 'Remove now!' button. The removal must be confirmed via a mail message sent to your address.
The control above is rendered by using the following source code in the Html designer
HTML<csx:SubscriptionRemover RunAt="Server"
Id="SubscriptionRemover1"
CssClass="control"
SuccessText="The subscription was removed!"
ConfirmationMailSenderAddress="info@corp.com"
ConfirmationMessageDocument="/news/newsUtils/confirmRemoveMailMessage.aspx"
RequiresConfirmation="True"
DefaultNoSubscriptionText="You currently have no subscriptions."
NothingSelectedText="Please, select at least one subscription!"
CommentText="Select the subscriptions you would like to remove and press the 'Remove now!' button. The removal must be confirmed via a mail message sent to your address."
CommentCssClass="smallface"
IncludeDisabled="True"
Text="Remove your subscriptions"
SuccessUrl="/news/newsUtils/afterRemoveSuccess.aspx"
Text="Remove your subscriptions"
ButtonText="Remove now!" />
In the page's Load event you must include code that tells the control the identity
(in the
// This will run on page load
protected void Page_Load(object sender, EventArgs e )
{
// Enter code here...
SubscriptionRemover1.Identifier = "john.doe@corp.com";
}
See also
SubscriptionManager Control