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 inInlineCssEmailAdjuster - Move
LegacyMailerHelperinto 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
Issue fork symfony_mailer-3613491
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
Comment #3
adamps commentedComment #4
adamps commentedComment #5
adamps commentedI'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.
Comment #6
adamps commentedComment #7
adamps commentedComment #8
adamps commentedComment #9
adamps commentedComment #11
adamps commented