Provide a way to switch theme for compat mails

Created on 16 March 2023, about 2 years ago

Problem/Motivation

When using the Postoffice Compat module in order to route legacy core and contrib mail through postoffice, some parts of a mail is typically rendered within a hook_mail implementation. This can lead to inconsistent selection of templates and CSS for sites which use separate backend and frontend themes.

Steps to reproduce

Typical symptoms of this problem are:

  • Simplenews newsletter is rendered with backend theme (when sending test issue) and frontend theme (when sending to real subscribers via cron).
  • Commerce order receipt is rendered with backend theme (when resending a receipt from the backend) and frontend theme (when a receipt is sent after an order was placed).

Proposed resolution

Introduce an optional module which comes with a decorator for the mail manager service. This decorator uses the same mechanism to switch to the default theme as the postoffice Theme mailer middleware.

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Fixed

Version

1.1

Component

Code

Created by

🇨🇭Switzerland znerol

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

Comments & Activities

Production build 0.71.5 2024