Score:0

Theming mime mail rule email send

tk flag

I've got a rule that fires properly and sends an email after a comment is saved. I want to theme this specific rule using the documented method.

My template name: mimemail-message--rules--ticketcomments.html.twig

I created a mail system module with the same "key" name.

Theming to the mimemail-message--rules.html.twig does work.

What am I missing?

id flag
Which documented method?
No Sssweat avatar
ua flag
@cilefen I think he's referring to [`mimemail-message--[module]--[key].html.twig`](https://www.drupal.org/docs/contributed-modules/mime-mail/theming-email-sent-by-mime-mail)
rd89 avatar
tk flag
Hey! Yep that's correct. In the contrib template files there's some instructions on how. In D7 I believe you can set a key for the email, in D9 that doesn't appear to be there.
No Sssweat avatar
ua flag
[D9 version does have it](https://git.drupalcode.org/project/mimemail/-/blob/8.x-1.x/mimemail.module#L73). Maybe you have the wrong key? You could check it with [hook_mail_alter](https://api.drupal.org/api/drupal/core!core.api.php/function/hook_mail_alter/9.2.x) and log the key, `\Drupal::logger('my_module')->error($message['key']);` and check the Drupal log.
rd89 avatar
tk flag
First thank you for the help! Added the hook to my custom module that was already trying to add a key - watchdog comes back with 'Column 'message' cannot be null'.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.