Setting to enable token replacement in newsletter issue fields

Created on 9 March 2019, about 6 years ago
Updated 7 March 2024, about 1 year ago

This module automatically supports personalisation by means of tokens in newsletter nodes. For some sites/newsletters, that might not be needed so there should be a setting to disable it.

Reasons:

  1. Token replacing is bad for performance and cacheability. simplenews_node_view() causes every newsletter page to vary per user. In particular this affects a site where a main content type used to display "article/blog" also has newsletter enabled to allow sending out the blog by email.
  2. When editing a newsletter page, this module adds a 'Replacement patterns' section. This is baffling to a non-techy editor, and the developer might prefer not to show it.
  3. If a batch contains more than 20 authenticated users, you hit a "recursion" limit as described in Add setting to disable per-user rendering Active . This is a core limitation: 🐛 Can only intentionally re-render an entity with references 20 times Needs work .

The default value of the new setting was changed to FALSE in #3248026: Problems with inserting tokens in newsletter fields .

Feature request
Status

Fixed

Version

3.0

Component

Code

Created by

🇬🇧United Kingdom adamps

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇰Denmark ressa Copenhagen

    Adding Token support was great, and it works well -- thanks!

    However, it looks like Token support is enabled by default, whether or not you enable it under Simplenews > Newsletter - /admin/config/services/simplenews/settings/newsletter:

    Customization

    [ ] Newsletter tokens (caution)
    Enable tokens in newsletter issue fields. Show a token browser on the node edit page and replace tokens when viewing a node (which may reduce performance). [...]

    If Tokens are always enabled, perhaps the text could be updated to this?

    [ ] Enable token browser (caution)
    Enables token browser in newsletter issue fields. [...]

Production build 0.71.5 2024