Campaign Manager

Send professional campaign messages to your subscribers.

Subscriptions Component

The campaignSubscriptions component lets subscribers manage their own list memberships, cancel their subscription or reactivate a cancelled one. Only lists with Allow subscribers to manage their list membership enabled are shown. Other lists are not changed by the form.

Property Description
code The secure subscriber code, usually supplied by a route parameter. Default: {{ :code }}
showListsPreview Shows the available lists on the reactivation view.
confirm When reactivating a cancelled subscription, send a confirmation email instead of confirming immediately.
templatePage The campaign template page used to generate the confirmation link, when confirmation is required.

Basic Usage

The subscriber is identified by the code query string, a route parameter or the component property. When no valid code is present, the component shows an email form and sends the subscriber a link to the same page, using the responsiv.campaign::mail.manage_subscriptions mail template.

title = "Newsletter Subscriptions"
url = "/newsletter/subscription"

[campaignSubscriptions]
code = "{{ :code }}"
showListsPreview = 1
confirm = 1
templatePage = "campaign/default-template"
==
{% component "campaignSubscriptions" %}

The component works both as the destination for emailed management links, and as the page where subscribers can request a fresh link.

Example Pages

This example implements a complete subscribe and unsubscribe flow, where every step ends on the subscription management page above.

Campaign Template

In the campaign template, set verifyPage and unsubscribePage to the landing pages below. Set unsubscribeFrom to account when the unsubscribe link should cancel the subscription, or list when it should only remove the subscriber from the lists used by that campaign. See the Template component.

title = "Default template"
url = "/campaign/message/:code"

[campaignTemplate]
isDynamic = 0
verifyPage = "newsletter-verify-subscriber"
unsubscribePage = "newsletter-unsubscribe"
unsubscribeFrom = "list"
==
...

Verification Page

The verification page shows a confirmation and then redirects to the subscription management page. The subscriber code is passed in the code query string.

title = "Newsletter Verified"
url = "/newsletter/verification"
==
<h2>
    Your newsletter subscription has been verified!
</h2>
<p>
    Redirecting to the subscription management page in a few seconds...
</p>

{% put scripts %}
    <script>
        setTimeout(() => {
            window.location.replace("{{ 'newsletter-subscription-management'|page }}?code={{ this.request.code|url_encode }}");
        }, 5000);
    </script>
{% endput %}

Unsubscribe Page

The unsubscribe page shows a confirmation and then redirects to the subscription management page.

title = "Newsletter Unsubscribed"
url = "/newsletter/unsubscribe"
==
<p>
    You have been removed from our mailing lists!
</p>
<p>
    Redirecting to the subscription management page in a few seconds...
</p>

{% put scripts %}
    <script>
        setTimeout(() => {
            window.location.replace("{{ 'newsletter-subscription-management'|page }}?code={{ this.request.code|url_encode }}");
        }, 5000);
    </script>
{% endput %}

Subscription Management Page

Save the page from Basic Usage as newsletter-subscription-management.htm.

← Back to Documentation

Previous: Signup Next: Template