Simplenews node issue should be rendered in Subcribers preffered language

Created on 28 November 2023, 7 months ago
Updated 13 January 2024, 6 months ago

Problem/Motivation

Im using symfony_mailer and simplenews together with content_translation.
When creating, translating and dispatching node issues with the given stack, The nodes should be rendered in the Subscibers preferred language!

Steps to reproduce

  1. Install and setup symfony_mailer and simplenews (default setup, follow the module instructions)
  2. Enable the symfony_mailer simplenews override to hand rendering of simplenews to symfony_mailer
  3. Enable content translation module and setup at least two content languages for your site
  4. Setup a newsletter list with at least two Subscibers with different preffered language
  5. Create a node, write some text into the body and set the simplenews issue to the newsletter list.
  6. Create translations for the node and translate the actual body
  7. Let symfony_mailer + simplenews deliver your node

⚠️ All Subscribers receive the email in sites default language ⚠️

Problem cause

The problem seems to be that EntityViewBuilder::view() is not provided with a langcode from Email::setBodyEntity(), hence "defaults to the current content language." and this is always the sites default language, cause the cron/spooler (initiating the email deliveries) does not care for the preffered language of individual Subscribers.

Proposed resolution

Add $langcode parameter to EmailInterface::setBodyEntity(...) so an EmailBuilder gets in power to control the rendering language of BodyEntities.

Remaining tasks

User interface changes

API changes

Added optional $langcode parameter to EmailInterface

Data model changes

🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇩🇪Germany TomSaw Essen

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

Merge Requests

Comments & Activities

Not all content is available!

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

Production build 0.69.0 2024