There have been a number of times when I've needed functionality from more than one module implementing drupal_mail_wrapper. It would nice if these modules could cooperate with each other. The only way to have cooperation is to create this wrapper as a hook.
Comments
Comment #1
mr.baileysCan you share some use cases? I can see how it would be useful for logging/troubleshooting, but other than that I don't know...
A hook like 'hook_mail_process' or 'hook_mail_send' would be better from a DX perspective, but there is the risk of sending multiple emails when more than one module implements this hook.
Comment #2
mr.baileysClosely related to: #331180: fix pluggable smtp/mail framework
Comment #3
sun.core commentedActually, I think it's a duplicate.