Cannot save a custom transport because the Symfony static Transport class is used

Created on 26 November 2023, about 1 year ago
Updated 14 February 2024, 10 months ago

Problem/Motivation

Similar to ✨ Ability to use custom transports with symfony/mailer Needs work .

When attempting to use a custom transport like hafael/azure-mailer-driver the transport is registered (by adding a new service with the appropriate tag), but it is impossible to save the DSN without an error like:

Invalid DSN: The "azure" scheme is not supported.

This is because of this line:
https://git.drupalcode.org/project/symfony_mailer/-/blob/4e9c789065a8bc9...

which only uses the "default" factories and not the injected factories.

Steps to reproduce

  1. Add hafael/azure-mailer-driver
  2. Create a service with config like:
        azure_mailer.transport_factory:
          class: Hafael\Azure\Transport\AzureMailerTransportFactory
          tags:
            - { name: mailer.transport_factory }
    
  3. Attempt to save an azure DSN

Proposed resolution

Use a service with the injected transport factories rather than the static class.

Remaining tasks

  1. Write a patch
  2. Test patch

User interface changes

N/A

API changes

Registered DSNs will work where previously they did not.

Data model changes

N/A

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States davidwbarratt

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

Comments & Activities

Production build 0.71.5 2024