Add message on the reroute settings form if Drupal Symfony Mailer is enabled

Created on 2 October 2023, over 1 year ago
Updated 28 November 2023, about 1 year ago

Problem/Motivation

It would be great to have an information message on the reroute settings form if Drupal Symfony Mailer is enabled (with some instructions on how properly use the module).

@see META issue: πŸ“Œ [META] Drupal Symfony Mailer support Active

Blocked by ✨ Support symfony_mailer, which doesn't use hook_mail_alter Fixed

πŸ“Œ Task
Status

Fixed

Version

2.3

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine bohart Lutsk, Ukraine

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.

  • Issue created by @bohart
  • πŸ‡ΊπŸ‡¦Ukraine bohart Lutsk, Ukraine
  • First commit to issue fork.
  • Status changed to Needs review about 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine abyss

    Added a messages with instructions for setting up the module with Symfony Mailer.

  • πŸ‡ΊπŸ‡¦Ukraine bohart Lutsk, Ukraine

    Hi @abyss,
    thanks for your contribution!

    1) We need to add a few really simple tests:
    a) for the main module: none of those messages are added on the settings page.
    b) for submodule (which has Drupal Symfony as its dependency):
    - the correct message is added on the settings page if Symfony Mailer is enabled and submodule is not.
    - no messages are added on the settings page if Symfony Mailer and submodule are installed.

    2) We need to add hook_requirements to the main module.
    So, if we have Symfony Mailer is enabled and submodule is not, we will see an notice at Status report page.

    3) This is a bit weird to have multiple addMessage in a row. Please replace the logic with:

    if ($this->moduleHandler->moduleExists('symfony_mailer')) {
          if ($this->moduleHandler->moduleExists('reroute_email_symfony_mailer')) {
             $this->messenger->addMessage(WHOLE MESSAGE #1);
          }
          else {
             $this->messenger->addMessage(WHOLE MESSAGE #2);
          }
      }
  • Status changed to Fixed about 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine bohart Lutsk, Ukraine

    Committed to 2.3.x dev branch. It will be a part of the next 2.3 series releases.
    Thanks!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024