Download & Extend

Expose setting for the inline vs. footnote handling of links in plain-text emails

Project:Mime Mail
Version:5.x-1.x-dev
Component:User interface
Category:task
Priority:normal
Assigned:dww
Status:closed (won't fix)

Issue Summary

mimemail_html_to_text() has a nice optional 2nd argument to control if you want your links as footnotes or inline. However, there's no way to control that from the UI, yet it's the kind of thing people might want to change. This patch just changes that function so that if the 2nd arg isn't specified, we check a variable instead of directly assuming footnote-style links, and adds a new fieldset for text-only settings on the admin settings page with a radio to toggle this. The fieldset is expanded automatically if you've selected the "Plaintext email only" checkbox. See attached screenshot.

Patch applies cleanly to HEAD and DRUPAL-5.

I'm using a fieldset for this since I'm planning to submit another issue to add another setting in there, anyway, stay tuned. ;)

AttachmentSize
mimemail_link_setting.png25.26 KB
mimemail_link_setting.patch2.12 KB

Comments

#1

As I understand it, D6 has some sort of html-to-text processing of its own ( http://api.drupal.org/api/function/drupal_html_to_text/6 ). I was hoping to ditch this fuction in favor of core handling, but adding this patch would then create some functional regression.

Do you agree, or do you think there's some way around this?

#2

Status:needs review» closed (won't fix)

Yeah, I looked at that function (and http://drupal.org/project/html_to_text) just after submitting this. :( Stupid core. ;) I dunno what to say. The functionality is in there already in mimemail, and people might be using it. I'm just exposing a setting to control it.

In terms of porting to D6, yeah, I guess we're doomed since core makes this hard-coded.

It also hard-codes the other thing I was going to provide a knob for (the width to word-wrap to). I even had my patch all ready to upload. :(

I guess "won't fix" is appropriate, if you're (wisely) planning to rely on core for this functionality, but (as usual) core is too inflexible to handle it as you're currently using it. If that's definitely your plan, seems like #258026: Rip out html_to_text code and depend on http://drupal.org/project/html_to_text should be a high priority for the D5 version, no?

I suppose I could open a D7 core issue to restore inline link handling as an option, so that in 2 years I can use this functionality again. ;)

Or, I could just munge my own input before I hand it off to mimemail so that my links are already inline and no longer in <a href> tags, so that mimemail and everything further down the chain doesn't mess with them.

nobody click here