Allow collecting stats for users without subscriber entities

Created on 1 December 2023, about 1 year ago

Problem/Motivation

Simplenews allows for custom recipient handler plugins to dynamically create lists of users to send an email newsletter issue to, without those users needing to have subscribed to a newsletter. Although Simplenews creates a temporary subscriber for those users there is no subscriber ID and Simplenews Stats checks for a subscriber ID in many places to determine whether or not to store stats for that subscriber. As a result the tracking image is never added to the email and the links are not rewritten to allow for tracking clicks.

Steps to reproduce

Send a newsletter issue to a newsletter with recipients populated by a user recipient handler. No tracking image is added and links are not rewritten.

Proposed resolution

In Simplenews RecipientHandlerBase.php, buildEntityQuery() specifies a recipient handler to be a simplenews subscriber or user. Check if the current recipient is a user without a subscriber entity, and if so allow the stats to be recorded.

Code to follow.

Feature request
Status

Needs review

Version

3.0

Component

Code

Created by

🇬🇧United Kingdom jeni_dc

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024