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!

CommentFileSizeAuthor
#7 mimemail-962226-7.patch5.41 KBsgabe
#5 mimemail-962226-5.patch6.39 KBsgabe

Comments

sgabe’s picture

IMHO the solution would be using different mailkeys for different Rules. I will take a look at it.

rchuber’s picture

Thanks 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.

kiwad’s picture

Just 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

sgabe’s picture

Title: Different Templates for Same Mailkey » Use unique mailkeys for Rules messages
Category: support » feature

I am changing the issue settings to better reflect the situation.

sgabe’s picture

Title: Use unique mailkeys for Rules messages » Allow custom mailkeys for system and Rules action messages
Status: Active » Needs review
StatusFileSize
new6.39 KB

Initial patch to allow custom keys for system and Rules action messages.

sgabe’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)

Committed to D6, needs to be ported to D7.

sgabe’s picture

Status: Patch (to be ported) » Fixed
StatusFileSize
new5.41 KB

The attached patch has been committed.

iLLin’s picture

Just 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.

sgabe’s picture

I 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.