Simplenews node issue not rendered in Subcribers preffered language

Created on 28 November 2023, 12 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. Create a node, set it as an simplenews issue and translate it to the other site content languages
  5. Let simplenews send your newsletter to subscribers with differnet preffered languages (langcode) set

-> They all 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 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 review

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.71.5 2024