Hi,

I would suggest to put a higher module weight to mailsystem (weight > 128) because otherwise hook_mail_alter of other modules might get called after hook_mail_alter of mailsystem.

In my setup (mailsystem + html mail + mail mime) the current module weight of 0 has the following effect: The HTMLification of my mails is done before my custom modules can alter mails with hook_mail_alter, so the HTML mails which are sent out are the unaltered versions of the mails.

Comments

pillarsdotnet’s picture

Status: Active » Postponed (maintainer needs more info)

What are these other modules?

tobi20’s picture

These are custom modules programmed by myself.

Nonetheless, I think this is really common: Say, you want to have a footer on all your mails. Then you will typically create a module which implements mail_alter. This module should be called as late as possible so that the footer is attached to the outgoing mails at the very end.

But the HTMLification of the mails (through mailsystem) should be done after the footer has been attached.

pillarsdotnet’s picture

Status: Postponed (maintainer needs more info) » Postponed

I am going to write a module that provides an administrative user-interface to re-order all module weights.

john.oltman’s picture

pillars, you may want to look at the Util module for module weights - it does that already (among other things) and they are working on a D7 port:

http://drupal.org/project/util

pillarsdotnet’s picture

Status: Postponed » Closed (duplicate)