As far as I can understand, SMTP module provides a full MailSystemInterface implementation, which lets use SMTP module as a standalone mail solution. However, it would be nice to code this in a way it could be integrated with another modules, such as mimemail, which handles HTML, themeing, images and all other stuff.
I really don't know if this is possible, at some extent. If it's not, mimemail should go for it's own smtp implementation, but I dislike that solution.
Issues related:
#1088914: The Mime Mail module should use the Mail System module
#1110876: D7 Status?
#1112872: Must send through an SMTP server, any options for HTML mails?
#1124252: The SMTP module should use or support the Mail System module
#1179792: Integrate with other mail modules
Comment | File | Size | Author |
---|---|---|---|
#12 | integrate_with_mailwire-1125778-12.patch | 1.99 KB | pluess |
|
Comments
Comment #1
yettyn CreditAttribution: yettyn commentedI fully agree with you! As a co-maintainer I have had zero time lately to work on the module though but as my ordinary life work schedule eases up these are the things I would like to look at and probabbly work together with devs of concerned modules as most likely changes are needed there too.
Comment #2
pillarsdotnet CreditAttribution: pillarsdotnet commentedI have submitted patches to enable the feature that you are requesting.
See #1124252: The SMTP module should use or support the Mail System module
and #1088914: The Mime Mail module should use the Mail System module
Comment #3
wundo CreditAttribution: wundo commentedSorry, but as I told you in #1124252, IMHO adding another dependency is not way to go. I see you're the maintainer for Mail System module, but pushing other modules to use your API this way doesn't look nice.
Comment #4
pillarsdotnet CreditAttribution: pillarsdotnet commentedComment #5
jorge.suarez CreditAttribution: jorge.suarez commentedPlease be nice, people! We're all trying to help here.
Wundo, you told pillarsdotnet on #1124252 that pushing dependencies is not way to go and asked the benefits, then pillarsdotnet told you and the conversation ended. I suppose that pillarsdotnet didn't convince you? Why? It would be nice to tell us.
I'm not an expert so maybe this is not possible, but isn't there any way to add this as a recommendation rather than a dependency? Check for Mail System module presence and use it accordingly, just if present.
I think you're right when you say that adding dependencies is not very nice, but Mime Mail already depends on Mail System and this solves the integration problem.
Comment #6
pillarsdotnet CreditAttribution: pillarsdotnet commentedIn 7.x Mail System could be a recommendation rather than a dependency, but any module that did so would become larger and more complicated, rather than shorter and simpler. So there is no benefit.
In 6.x, both Mail System and SMTP Authentication Support set the
smtp_library
variable and definedrupal_mail_wrapper()
. Only one module can do that, so SMTP Authentication Support 6.x is incompatible with Mail System and also with any other 6..x module that setssmtp_library
and definesdrupal_mail_wrapper()
.Since only one module can define
drupal_mail_wrapper()
, I think it should be a module designed to cooperate with other mail-sending modules, rather than one designed to exclude other mail-sending modules.Comment #7
wundo CreditAttribution: wundo commentedHi Jorge,
I'm beeing nice.
Quoting what I said in the other isse (#1124252: The SMTP module should use or support the Mail System module) was:
After that he started to flame (see #4).
Comment #8
wundo CreditAttribution: wundo commented#6:
Please behave, you have no reason to assume that I "think that cooperation is a bad thing and therefore disagree", all I did was just ask for more info about what would be the benefits from that integration, that is a simple innocent question.
Your last two comments on this thread weren't nice at all, I don't see the reason you got so mad.
Also if you are talking about me please address me directly.
Comment #9
josesanmartin CreditAttribution: josesanmartin commentedI don't think it's good to add dependencies unless there's a strong rationale for that. It makes it harder for users to install and, most important of all, update this module. We should keep in mind the philosophy "if it's working, don't fix it", for 6.x version at least. Mimemail works great with SMTP.
That said, we are all open to discussion, if you (pillarsdotnet) make a strong case for mailsystem. For instance, why should SMTP be a dependency of MailSystem, instead of MailSystem implementing the SMTP integration, the same way Views does with node.module? How does it make our users' life easier?
Comment #10
pillarsdotnet CreditAttribution: pillarsdotnet commentedI would rather add a dependency; others would rather duplicate the same code in different modules. Apparently we cannot agree on this.
I really do wish Wundo, and other module authors like him, all the best.
It saddens me somewhat that, after breaking up my module into several pieces so that they would be useful on their own, and after taking
several hours of my time to compose patches to show other module authors how we can work together instead of in competition, my efforts appear to have been wasted.
Perhaps if I were more diplomatic and tactful that would not be the case, but I am who I am.
Comment #11
yettyn CreditAttribution: yettyn commentedPlease folks, don't let emotions cloud your judgement, and please don't close an issue "won't fix" unless you are maintainer of the module, and don't close someone else issue unless you are maintainer, have a fix commited or it has become irrelevant due to age etc.
Hence, I'm reopening this as it's highly relevant and it's also related to #1124252: The SMTP module should use or support the Mail System module even if I'm not sure what's the correct solution. I think pillar is on the right track although, and I say this without having looked through all code yet, my intuition tells me that Mailsystem (or part of) and SMTP belongs together somehow. But this also needs to be looked at in view of D8 as this is really a "core issues" in my opinion.
But again, and it's the 3rd issue I state this in now, I don't have time to work on this right now so unless someone else is willing to pick it up, it has to wait. Not too long though as even if not critical I think it's major.
Comment #12
pluess CreditAttribution: pluess commentedAs many others, I'd like to have several mail sending/formatting modules at the same time. For me it's mimemail, maillog and smpt. Currently this is not possible using the mail_sytem variable. As far as I understand this problem is not solved by using the http://drupal.org/project/mailsystem module.
For this reason I've written a new module called mailwire (http://drupal.org/sandbox/pluess/1179376). It provides two hooks hook_mailwire_sender() and hook_mailwire_formatter(). Using this hooks any mail formatting/sending module can register any number of formatters and senders. Everytime drupal_mail is called the formatters and senders are called depending on module, key and weight settings.
I've written patches for mimemail, maillog and smtp to integrate with mailwire.
See: #1179792: Integrate with other mail modules and http://drupal.org/sandbox/pluess/1179696
I Hope this is pushing the integration of all the nice mail sending and formatting modules ahead!
The Patch is done via "git format-patch"
If the patch is applyed, can you please use:
git am --signoff --ignore-whitespace < integrate_with_mailwire-1125778-12.patch
this should keep the commiter for my account :-).
Comment #13
pillarsdotnet CreditAttribution: pillarsdotnet commented@#12 -- Actually, mailsystem *does* provide this facility, but by using the mail_system variable instead of by registering new hooks.
But if you come up with an improved strategy, and convince module authors to adopt your strategy instead of their own, I'll mark Mail system deprecated and support your module, instead.
Comment #14
pluess CreditAttribution: pluess commentedCould you please explain how the mailsystem module can do that?
If I look at the D7 core code in mail.inc this seams to be impossible.
drupal_mail_system
can return only one MailSystemInterface implementation anddrupal_mail
calls only this one.In order to integrate several mail formatting / sending modules we need a solution which can invoke any number of formatting/sending implementation in a configurable order.
IMHO: This is only possible by implementing a mailsystem which does that. Mail formatting/sending modules are not mailsystems but just different ways of formatting and/or sending emails. They should not touch the mail_system variable at all.
Comment #15
pillarsdotnet CreditAttribution: pillarsdotnet commented@#14 -- See #1135262: drupal_mail() should support using different MailSystemInterface classes for format() and mail()
Comment #16
pluess CreditAttribution: pluess commentedI'm happy to see that there's something going on for D8, however we need a solution for D7 (as you can see from the version property) as the D7 core solution isn't enough.
BTW: mailwire is doing what has been proposed in #6.
Comment #17
pillarsdotnet CreditAttribution: pillarsdotnet commentedMail System is also doing what was proposed in #6, and is available right now for d6, d7, and d8. The proposed patch (which must be against d8 first, then d7 and d6 if backported) just makes it easier and cleaner for Mail System to do its job.
Comment #18
pluess CreditAttribution: pluess commentedCould you please explain this in detail? I cannot find any documentation or code in the mailsystem module which allows for a number of mail modules to be called in a chain. I would be more than happy to use the mailsystem module if it can do this!
Feel free to contact me on skype or irc so we can take the time to sort this out and then come back with a god solution. Maybe it's just a matter of documentation?
Comment #19
pillarsdotnet CreditAttribution: pillarsdotnet commentedDruplicon says:
I guess your module does provide an orthogonal service. Mail System promotes co-existence of separate mail modules, where each one handles a specific module/key/method. Yours, I take it, allows multiple separate modules to format and send the same message.
I think the efforts should be combined, though. I'd also like to add the following features:
Comment #20
pillarsdotnet CreditAttribution: pillarsdotnet commentedSee Using HTML Mail together with SMTP Authentication Support
and Review of Mail Wire module
Comment #21
pillarsdotnet CreditAttribution: pillarsdotnet commentedI have a patch and a working implementation to allow multiple mailsystems such as HTML Mail and SMTP to cooperate and co-exist.
The Mailwire module has some good ideas, but also many problems.
Comment #21.0
donSchoe CreditAttribution: donSchoe commentedupdated related issues
Comment #22
DamienMcKennaPlease don't forget to set the issue status to "needs review" when you upload a patch.
Comment #25
DamienMcKennaThe patch should also make Mailwire optional, there's no reason to require it.
Comment #26
wundo CreditAttribution: wundo at Chuva Inc. commentedClosing very old (dead) issues, if you think this is still relevant please re-open.