Closed (fixed)
Project:
Mime Mail
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 Oct 2011 at 15:34 UTC
Updated:
15 Nov 2011 at 12:31 UTC
Jump to comment: Most recent file
Comments
Comment #1
sgabe commentedI miss the part why you can't use absolute links for the images in E-Publish? Why Mime Mail needs to create the correct links?
Comment #2
sdague commentedBecause these are just picking up the images that are in nodes directly, that content being created by at least a dozen other people. I've also got the same issue with node_announce (which I own) and the print module (which I don't).
In all these cases the mailing modules could be made to preprocess the html before sending it to mimemail. But with 20 lines of code in mimemail it can instead do this at a site level for all the emails sent out, regardless of originator, which is what is desired from a site policy perspective.
Comment #3
sgabe commentedI think it is the responsibility of the user to provide content that fits for his needs. At first glance this option makes the absolute links and the embedding exclusive. If I enable the option I won't be able to send messages with embedded images anymore.
I think you just need to document this behavior so the users can decide what to do: if they want to send embedded images, they will use a relative path, otherwise they can use an absolute path. If they want to reduce the size of the message, they can use ImageCache (and not just manually resize the image in a WYSIWYG editor).
I will include module specific patches only if there is a very very good reason to do it. As I mentioned before I see no obstacle of using absolute links when creating the content that will be sent out via Mime Mail.
Comment #4
sdague commentedThat may work fine for a site where the editors are all computer people, but it works very poorly for the non profits I support. They have no idea what kind of link an image has, it's added just via WYSIWYG and the IMCE bridge. They don't have the skills or understanding to go into the html and make those changes. And avoiding training farmers on html is the reason I chose Drupal in the first place. :)
It is exactly the point that for the 3 sites that I support we don't want any embedded images in any email. People complain loudly when their email is getting filled up with the large messages. This is true for all sending of email that we use, coming from multiple modules, as well as mimemail actions.
While this might not be your use case for sending email, I think it's a very common one. Making it site policy just like site policy of whether or not to specify css seems exactly right.
Comment #5
sgabe commentedI understand the problem, but this is not the right solution for it. You should search for another solution or try the Pathologic module, I think that's exactly what you need.
Comment #6
sgabe commentedYou may also be interested in TinyMCE - URL conversion, furthermore I found Relative Path to Absolute URLs.
I am closing this issue.
Comment #7
sgabe commentedI have also found Absolute src.
Comment #8
sdague commentedWell, it's unfortunate that you won't fix it, because forcing all the urls to absolute in the code isn't an option. That means we can't have a test server with independent content because the full url is embedded. One of these sites already underwent a name change, and if I'd implemented this the way you said, it would have caused dozens of hours of rework.
Using absolute urls for local content just to work around behavior of mimemail seems really the wrong approach.
Guess I'll just keep maintaining my own patch to mimemail for this.
Comment #9
sgabe commentedI guess you didn't try the proposed solutions in my previous comment. You would not need to store the absolute paths, there are available and good solutions for your problem.
However if you want to do it this way, you can implement hook_mail_alter() in a custom module so you don't need to patch up Mime Mail every time when a new version comes out.
Embedding images is one of the essence of Mime Mail. If you only want to use HTML for your messages I think you can use HTML Mail. Some ways that can be a better choice.
Comment #10
sdague commentedMy interest with mimemail is the fact that it correctly generates multipart/alternative email so there is both an html version and a text version. And I'd been using it for a while, so I was encouraged to add what I considered a useful feature.
I didn't expect this to be so contentious, as it was a relatively small amount of code, that was disabled by default, and just gave mimemail users additional option for usefulness.
I'll look into HTML Mail to see if that would do what I need.
Comment #11
sdague commentedIt appears that HTML Mail only provides multipart/alternative if mimemail is installed, which means it would run into the same issue.
hook_mail_alter() approach doesn't seem to work in the test module I just wrote. I don't know if that hook is getting triggered when sending via mimemail. I'll do some more investigation at some point in the future here, because if I can actually made that change without a patch I need to keep rebasing, that would be great.
But the effort in keeping that patch up to date is actually pretty minor compared with completely rearchitecting things to use a different solution here (like correctly integrating and testing one of the approaches that changes the links in the content before they ever get to mimemail).
Sorry we couldn't see eye to eye here, as I really do believe this would be a feature of interest to a number of people.
Comment #12
sgabe commentedLets leave this in active status and see what others think about this.
Comment #13
sgabe commented@sdague: Please take a look at #1308630: Allow link modifications (e.g., to add campaign tracking) and share your thoughts with us. I think that's a good idea and can be a general solution for different use cases, including yours.
Comment #14
sgabe commentedI have been thinking about this... Let's get this in. Committed to both branches.
Comment #15
sdague commentedsgabe thanks for looking into this again.