How to run multiple email modules at the same time?
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/ho...), hook_node_info (http://api.drupal.org/api/drupal/modules--node--node.api.php/function/hook_n...) 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
Ernst Plüss wrote:
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.
I've always disliked this method or registration and for this very issue. Even the devel module can register a mail handler but that one is to try to prevent mail from being sent during development cycles.
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?
This of course has to do with actionable workflow where more than one module needs to operate on an action in some specified order. The hook system helps but not perfect if we need hook a of module foo to execute before hook b of module bar but hook a of module bar to execute before hook b of module foo. The module weighting system breaks the scenario.
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/ho...), hook_node_info (http://api.drupal.org/api/drupal/modules--node--node.api.php/function/hook_n...) 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.
Sounds interesting. I'll need to check out your module.
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.
Conversation is started. Again you're describing actionable workflow, and something may already exist but I don't know yet. -- Earnie -- http://progw.com -- http://www.for-my-kids.com
2011/6/22 Earnie Boyd <earnie@users.sourceforge.net>:
This of course has to do with actionable workflow where more than one module needs to operate on an action in some specified order. The hook system helps but not perfect if we need hook a of module foo to execute before hook b of module bar but hook a of module bar to execute before hook b of module foo. The module weighting system breaks the scenario.
Maybe mailwire should not introduce a weight for the formatters/senders and reuse the module weight. But as it is designed now a module can have any number of formatters and/or senders. How does the module weighting system break the weighting of the formatters/senders? I can see that having separate weighting systems might cause confusion and needs to be highlighted in the docs. But I cannot see any fundamental technical problem. Maybe we just need a GUI to give admins a chance to tweak the order of mail formatters and/or senders to their needs. For the filters (hook_filter_info) it's done like that.
Conversation is started. Again you're describing actionable workflow, and something may already exist but I don't know yet.
Well, we have the action and rules modules. But I think this modules do deal with WHEN a mail gets sent. Mailwire however deals with HOW it gets sent. Therefore I think we should not try to reuse action or rules for mail formatting/sending. An other argument against this is that it would put a heavy dependency (rules, entity API) on the mail handling modules. Regards Ernst
Am 22.06.2011 15:50, schrieb Ernst Plüss:
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.
Looks like this is duplicating the existing effort of http://drupal.org/project/mailsystem ? -- sun
2011/6/22 Daniel F. Kudwien <news@unleashedmind.com>:
Looks like this is duplicating the existing effort of http://drupal.org/project/mailsystem ?
The functionality of the mailsystem module and the mailwire module is completely orthogonal. The mailsystem module makes dealing with the mail_system variable less error prone. Whereas mailwire solves the fundamental limitation of the "mail_system approach". This is: There can be only one mail system (for a module or as default) at any given time.
participants (3)
-
Daniel F. Kudwien -
Earnie Boyd -
Ernst Plüss