- 🇬🇷Greece idimopoulos
idimopoulos → made their first commit to this issue’s fork.
Here’s a use case from my project:
message_notify
they are not enough. There's no way to add arguments describing the recipient. And such arguments are so important when you need personalised emails, for instance:Dear Joe Doe,
Your balance is now $35.5
And the message template would look like:
Dear @recipient:name,
Your balance is now @recipient:balance
Such arguments are per-recipient and they need to be computed on delivery phase.
hook_mail_alter()
but that doesn't look so goodN/A
Add an API that allows 3rd-party to interact before the message is assembled. For instance, when the email
plugin computes the sender and recipient emails, it's too late as the message render array has been already assembled.
Here's a proposal:
MessageNotifierBase::send()
, dispatch an event that allows 3rd-party to add more arguments or manipulate the notifier plugin configuration. For instance, having access to the plugin configuration that already contains the recipient email, a module, listening to the event, is able to get the user full name and set a new argument in the message entity.
::init()
method allowing some plugins to do preparations before the dispatcher runs. E.g. the email
plugin wants to prepare the from and recipient emails and the language code as well. The default implementation, MessageNotifierBase::init()
, has an empty body so that we don't break any plugin that doesn't need this method.None.
None.
3rd-party are able to subscribe to an event and hook in the process just before the message render array is assembled and the message is delivered. They can:
from
email addressNone.
Closed: works as designed
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
idimopoulos → made their first commit to this issue’s fork.