[development] How to run multiple email modules at the same time?

Ernst Plüss ernst.pluess at gmail.com
Wed Jun 22 13:50:03 UTC 2011


For our D7 websites we often have the need to run multiple email
modules at the same time.

Let's make an example: We want to sent mime encoded emails, make sure
every email gets logged and we want to send it using smtp.
There are nice modules for this: http://drupal.org/project/mimemail,
http://drupal.org/project/maillog and http://drupal.org/project/smtp.
But there's a problem. All of them do register itself as the default
mail system. This means only one of them can exist at the same time.
There's no way of letting them coexist and do their job one after the
other.

The mail system variable allows to set different mail_systems for
specific modules and/or keys. But that doesn't help. Even if we would
take the work and set maillog as the mail system for all our email
sending modules. How can we sent them via smtp after they have been
logged?

I think that the only solution is a central registry, similar to what
hook_filter_info
(http://api.drupal.org/api/drupal/modules--filter--filter.api.php/function/hook_filter_info/7),
hook_node_info (http://api.drupal.org/api/drupal/modules--node--node.api.php/function/hook_node_info/7)
or the wysiwyg module (http://drupal.org/project/wysiwyg) are doing
for their particular need.

Therefore I've written a module providing the appropriate hooks. Since
the idea is to wire together mail modules I called it mailwire
(http://drupal.org/project/mailwire). I provided also integration
patches for some mail modules.

Unfortunately I do not get a lot of feedback from the module
maintainers. What would be the right approach to start a discussion
and find a common solution? I think it would be big plus if Drupal
would have an easy way to run any number of email formatting and
sending modules in parallel.

Regards
Ernst


More information about the development mailing list