0

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?

5
  • Which documented method?
    – mona lisa
    Commented Apr 22, 2022 at 21:31
  • 1
    @cilefen I think he's referring to mimemail-message--[module]--[key].html.twig
    – No Sssweat
    Commented Apr 22, 2022 at 23:24
  • 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.
    – rd89
    Commented Apr 23, 2022 at 1:11
  • 1
    D9 version does have it. Maybe you have the wrong key? You could check it with hook_mail_alter and log the key, \Drupal::logger('my_module')->error($message['key']); and check the Drupal log.
    – No Sssweat
    Commented Apr 23, 2022 at 8:25
  • 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'.
    – rd89
    Commented Apr 24, 2022 at 2:57

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.