Campaign Manager

Send professional campaign messages to your subscribers.

User Registration

When the RainLab.User plugin is installed, the Campaign plugin integrates with it in two ways. Version 3 or above of RainLab.User is required for the registration opt-in.

Sending to All Users

The All registered users recipient group is available when launching a campaign, and sends to every registered user without needing a list. Users who have unsubscribed from your mailing list are skipped.

Opting In When Registering

Users can join your mailing lists when they create an account. Add a checkbox named campaign_lists[] to the registration form, with the list code as the value.

<form data-request="onRegister">
    <!-- ... -->

    <label>
        <input type="checkbox" name="campaign_lists[]" value="newsletter" />
        Send me the monthly newsletter
    </label>

    <button type="submit">
        Register
    </button>
</form>

Only lists with Allow subscribers to manage their list membership enabled are accepted. Other list codes are ignored, so visitors cannot add themselves to private lists by changing the form. Add one checkbox for each list you want to offer.

<label>
    <input type="checkbox" name="campaign_lists[]" value="newsletter" />
    Monthly newsletter
</label>
<label>
    <input type="checkbox" name="campaign_lists[]" value="offers" />
    Special offers
</label>

The subscriber is created with the user's email address and name. If a subscriber already exists with the same email address, they are added to the selected lists and keep their existing lists and meta data. Checking the box counts as a fresh opt-in, so a previous unsubscribe is cleared.

Confirmation

When the RainLab.User Send Activation Email setting is enabled, the subscriber is created unconfirmed and will not receive campaigns until the user verifies their email address. Verifying the account email also confirms the subscription, so the user is not sent a second confirmation email.

When activation emails are disabled, or the user's email address is already verified, the subscriber is confirmed immediately.

Enable Send Activation Email if you need double opt-in, otherwise anyone can subscribe an email address they do not own by registering with it.

Headless Registration

The opt-in reads the campaign_lists value from the registration input. When registering users with the RainLab.User action manager instead of the Registration component, pass the list codes in the input.

$user = \RainLab\User\Classes\ActionManager::instance()->registerUser([
    'first_name' => 'Jane',
    'email' => 'jane@example.com',
    'password' => 'ChangeMe888',
    'campaign_lists' => ['newsletter'],
]);

← Back to Documentation

Previous: Settings Next: Events