Problem/Motivation

With this feature, modules can unilaterally choose to use Mailer Plus to be used as a modern HTML-capable email API without forcing sites to change mail system. If the mailer_transport module is not enabled, then mails will instead be sent via the legacy mailer API.

Proposed resolution

This requires little new code, however it does need rearranging some existing code to different classes/modules.

  • Move/copy shared utility code that was in mailer_transport to symfony_mailer
  • Move TransportEmailAdjuster into mailer_transport
  • Remove the dependency of symfony_mailer on mailer_transport
  • Make the delivery service optional in MailerPlus.php, and if missing, send via legacy Mail System
  • Create symfony_mailer_mail_alter() to build the message from the email
  • Add Email::getCss() based on code that was in InlineCssEmailAdjuster
  • Move LegacyMailerHelper into symfony_mailer module and rename as LegacyConverter

This issue doesn't embed images. DSM-L uses the image: syntax followed by a filename, whereas we have an HTTPS URL. It might be possible, but fiddly. Also DSM-L only accepts images inside the public filesystem, which isn't always the case.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

adamps created an issue. See original summary.

adamps’s picture

Issue summary: View changes
adamps’s picture

Issue summary: View changes
adamps’s picture

I'm pleased with how this is working out. It works pretty well apart from embedded images without needing much new code at all.

This could open up the possibility for #3275129: Use Symfony Mailer API to send mails.

adamps’s picture

Issue summary: View changes
adamps’s picture

Issue summary: View changes
adamps’s picture

Issue summary: View changes
adamps’s picture

Issue summary: View changes

  • adamps committed 697efeda on 2.x
    feat: #3613491 Allow sending via legacy mailer
    
    By: adamps
    
adamps’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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