- Issue created by @philben
- ๐บ๐ธUnited States pixiekat
We use
hook_mail_alter
to alter the message (or disable it from being sent out all together).Target which message you want to alter with
$message['key']
and then edit$message['body'][]
.You can get the group with
\Drupal::routeMatch()->getParameter('group');
. - ๐ณ๐ฟNew Zealand philben
Thanks @Pixiecat.
The hook_mail_alter is a good way to handle it. My only issue is that it doesnโt work consistently; sometimes the default message goes through without the alter. Do you know what could be the issue? Iโm filtering the messages by key before altering.