Closed (fixed)
Project:
Mailer Plus (DSM+)
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
14 Oct 2022 at 15:12 UTC
Updated:
9 Feb 2025 at 11:29 UTC
Jump to comment: Most recent
Create a clearer and more useable interface closer to the direction preferred in discussions in the Core issue queues.
EmailFactoryInterface and EmailBuilderInterface::createParams().EmailBuilder adds a function with name and parameters appropriate to the service it provides, which is added to a new interface. For example UserEmailBuilder implements UserMailerInterface::notify(string $op, UserInterface $user). Now UserEmailBuilder has a wider scope than before and it entirely replaces _user_mail_notify() (rather than as before replacing user_mail().XXXMailerInterface in the symfony container for auto-wiring. The code using the service now has a proper documented interface to a service which can be loaded merely by adding a constructor argument.MailerInterface::newEmail() which returns an instance of EmailInterface that is in the initialisation phase.EmailBuilder calls this function and registers itself on the new email with addProcessor() (this being handled in the base class). It then makes various calls to setParam() and perhaps setTo(), finishing with send().EmailBuilderInterface::addProcessor() which adds a processor to the next email that is sent. This allows the code using the email service to customise the emails sent, and it's also useful for tests.symfony_mailer.add_processor. The mailer adds all services with this tag to all emails. Add the tag to EmailAdjusterManager.EmailBuilder or EmailAdjuster. They are a candidate for adding to Core.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 #4
elberHi I added a initial ideas to this issue please revise.
Comment #5
adamps commentedComment #6
adamps commentedComment #8
adamps commentedThanks @elber it was a good start.
Comment #11
adamps commentedComment #13
adamps commentedComment #14
adamps commented