I'm not sure if I'm just missing something or if this is a feature request.
I use Rules to dispatch a number of different e-mails, but they all have the same mailkey ("mail-mimemail-rules-action-mail"). Since the theming filename suggestions use this mailkey I haven't been able to find a way to theme each of them differently. It seems that this would be a fairly common situation, so perhaps I am confused.
(In the meantime, I'm thinking about using a formatless mimemail.tpl.php and an empty mail.css. This way I believe I can include the necessary css and template html inline in the HTML e-mail content field for each action.)
Thanks!
Comments
Comment #1
sgabe commentedIMHO the solution would be using different mailkeys for different Rules. I will take a look at it.
Comment #2
rchuber commentedThanks sgabe.
I just noticed that the e-mail subject is available in mimemail-message.tpl.php (I mistyped this filename above). For the time being, I can use some conditional logic in that file to accomplish what I'm needing based on this variable.
Comment #3
kiwad commentedJust to know if i'm on the right track. I wanna send an html mail with mimemail+rules from a specific node-type. To have a custom output, would I have to do a tpl.php file called mimemail-mail-mimemail-rules-action-mail.tpl.php (or will it need some other name) and define some classes in mail.css ?
Then, to have different templates, I could do this with something like if($recipient ==.. or if($subject == ...
Thanks for providing some enlightment
Comment #4
sgabe commentedI am changing the issue settings to better reflect the situation.
Comment #5
sgabe commentedInitial patch to allow custom keys for system and Rules action messages.
Comment #6
sgabe commentedCommitted to D6, needs to be ported to D7.
Comment #7
sgabe commentedThe attached patch has been committed.
Comment #8
iLLin commentedJust so people know, I upgraded to DEV and this broke all my HTML emails until I put in a key to fix them. I wonder if you should put in a default key to prevent the emails from breaking until you have a chance to change them to something more custom as the OP originally intended.
Comment #9
sgabe commentedI updated the release note with the committed patches and this information. Since similar changes (see #1568680: Use $message for themeing for example) are expected, trying to provide backward compatibility for an alpha release would be pointless.