Docs

Newsletter Integration

3 min readUpdated June 22, 2026

The Newsletter Plugin (by Stefano Lissa) is a self-hosted WordPress newsletter plugin. WP Smart Consent integrates with it via the plugin’s native PHP API — no external API key or internet connection required. The integration runs entirely on your server.

Enabling the Integration#

In the WP Smart Consent dashboard, go to CRMs & ESPs, find the Newsletter card, open the Connection tab, and toggle it on. The Newsletter Plugin must be installed and active on the same site.

A settings page titled "Newsletter" shows four tabs: Connection (selected), Field mapping, Custom fields, and Options. The "Enabled" switch is off. A message states no API key is needed. A green "Save Newsletter" button is at the bottom.

Custom Fields#

The Newsletter Plugin supports up to 20 profile fields (profile_1 through profile_20) defined in Newsletter → Subscribers → Profile fields. In the Custom fields tab, add a row, select the WPSC source field on the left, and enter the destination key on the right — for example profile_1, profile_2, or any of the native field keys listed below. These are merged directly into the subscriber data array.

A WordPress newsletter settings panel with tabs: Connection, Field mapping, Custom fields (selected), and Options. “Add Newsletter custom field” link and a green “Save Newsletter” button are visible. The status shows “Inactive” in the top right.

Field Mapping#

The Field mapping tab maps WPSC fields to Newsletter’s subscriber data keys. Native subscriber column names supported directly are name (first name), surname (last name), country, region (state), and city. Any destination key that is a profile_N key (where N is 1–20) is written to the corresponding profile field. Any other destination key is written directly to the subscriber data row as a column, so it must match an actual database column in the Newsletter subscribers table.

A web interface for a WordPress newsletter shows the “Field mapping” tab. A table lists standard destination keys—country, region, city. A note explains custom field keys. Buttons at the bottom read “Add mapping” and “Save Newsletter.” Status is marked as “Inactive.”.

How It Works#

WP Smart Consent calls Newsletter::instance()->save_user() with the subscriber data array. If the subscriber already exists (looked up by email via get_user()), their existing data is merged with the updated fields and save_user() runs an UPDATE using the existing subscriber ID. This approach allows targeting both public and private lists — unlike TNP::subscribe() which is restricted to public lists only.

The subscriber status is set as follows. A ticked opt-in checkbox creates the subscriber as status C (Confirmed) — explicit consent was given and no confirmation email is sent. A contact forwarded via Send on unchecked is created as status U (Unsubscribed) — the record exists in the database for audit purposes but the Newsletter Plugin sends no emails to them.

When updating an existing confirmed subscriber, WP Smart Consent never downgrades their status from C to S. If a subscriber is already confirmed, they stay confirmed regardless of the current opt-in context.

List assignments are stored as list_{id} = 1 columns in the subscriber data array, which the Newsletter Plugin maps to its list membership table. Both public and private lists can be assigned this way.

The full user data array can be modified before saving via the wpsc_newsletter_user_data filter. List IDs can be modified via wpsc_newsletter_list_ids.

Lists Tab#

The Lists tab is where you select which Newsletter lists opted-in contacts are added to. Both public and private lists are available for selection, unlike the Newsletter Plugin’s own subscription forms which only expose public lists.

Options#

The Options tab has two settings.

Update existing contacts — controls whether an existing subscriber matched by email has their fields and list memberships updated on each opt-in.

Send on unchecked — when enabled, contacts are forwarded to the Newsletter Plugin with U (Unsubscribed) status even when the opt-in checkbox was not ticked.

Screenshot of a "Newsletter" settings page. The "Options" tab is selected. Two toggle switches labeled "Update existing contacts" and "Send on unchecked" are off. There's a tags field and a green “Save Newsletter” button at the bottom. Status shows "Inactive.

Troubleshooting#

Contact not appearing — confirm the Newsletter Plugin is installed and active. WP Smart Consent checks for the TNP and Newsletter classes at opt-in time and skips the call silently if either is missing.

Profile field values not saving — confirm the destination key is profile_1 through profile_20 and matches a field defined in Newsletter → Subscribers → Profile fields. Keys that do not match a database column or profile field are ignored.

Subscriber not added to list — confirm the list IDs selected in the Lists tab are valid. Both public and private lists are supported. Check the WPSC Logs tab to confirm the opt-in event fired.

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only