So I sent myself a message using the contact module, and the message is prepended with a bunch of information that I felt would be confusing for a large percentage of my users. I decided to look into changing it, and possible changing the site name being prepended to the subject.
davidw, davidw (http://www.rism.ac.th/risweb/index.php?q=user/1) has sent you a message via your contact form (http://www.rism.ac.th/risweb/index.php?q=user/1/contact) at RUAMRUDEE INTERNATIONAL SCHOOL. If you don't want to receive such e-mails, you can change your settings at http://www.rism.ac.th/risweb/index.php?q=user/1. Message: Just checking the personal contact form.
Notice that the actual message itself is less than 20% of the total number of characters sent. In terms of usability this needs work. The solution to fixes this message is to install the locale module and translate the strings that form the message. However it seems to me that this is a feature the contact module should include by default, just like all of the other configurable email forms that exist.
I'm happy to install Drupal 7.x and work out a patch for this behaviour. It seems that there has been a push to keep the contact module small and light, but this feature would require an additional settings page, and slightly reworked logic to create the message so it's minimal code.
Anyone think this is worth adding to Drupal Core?
Comments
Comment #1
damien tournoud commentedThis message is passed thru
t()incontact_mail():That means that you can actually override it with the String Overrides module.
The usability issue here is tricky, because if you allow that message to be configured via the interface, you also loose the ability to translate it properly (except by installing i18n and playing with variable translation). This last issue is also a big one in term of usability on multilingual setups.
Comment #2
dwees commentedYes, I can install a module to override this one string. I can also edit this string in my settings.php file. I know it is possible to change this string, I just think that in a core module, fixing one string should be easier than the current options. The reason why this particular issue is important to me is that as I am developing a site, I want to make it as easy as possible for my end users to change things on the sites when I leave, without having to resort to learning Drupal + Php at an intermediate/expert level.
What is the performance hit per page for installing the stringoverrides module if I only want to "translate" this one string (given my content is all in English)?
If a multi-lingual set up is the only time when we have an issue with this (I can see the problem there, we'd have to let them translate it each time for each language somewhere, and inside the contact module is not the place to do that), is there a way of 'detecting' a multi-lingual set-up or is this too prone to upgrade and compatibility problems?
This is obviously part of a bigger issue, which is to require all of Drupal core be compatible with a multi-lingual set up, hence making changing strings in core more difficult than it needs to be. So it seems to me that this is "by design" or "won't fix".
Comment #3
dwees commentedAlso, we already do exactly what I am looking for in the various email messages for the user module. Shouldn't these be translatable too then, by the same logic (since it is conceivable one could create a registration form in multiple languages)?
Dave
Comment #4
gpk commentedThe user registration/account setup emails can be configured at admin/user/settings. Seems reasonable that the additional stuff output by contact.module in its emails should also be configurable on a settings page provided by core.
Having said that String overrides is a must-have for tweaking user interface text on a monolingual English site.
[update] Also there is hook_mail_alter(). Check the full content of $message especially $message['params'] ... should be possible to modify $message['body'] to get it as desired.
Comment #5
guillaumeduveausub
Comment #6
dave reidThis is not likely to make it into Drupal 7. Let's put this on our TODO list for D8.
Comment #7
dave reidComment #8
dave reidSee also #517044: Improve text handling, texts in text files (editable, overridable, translatable, etc...) and #365934: Handle big texts / module text files / readable and localizable / get rid of _user_get_text()
Comment #9
shark commented+1 on this. I'd love an easy to set the format to something a bit more user friendly (namely, putting the message closer to the top followed by additional info, as is pretty standard on emails like from mailing lists or automated systems):
Comment #10
NickAT commentedI agree, since several other mail types are templated/tokenized for admin edits, it only makes sense to add this as well. Particularly since the default configuration adds information that may confuse the general end-user, as stated above.
Comment #11
j4 commentedWe could also go one step more? And give the admin a checkbox with an option to include or not the text about changing settings?
Jaya
Comment #12
webchickD8 is available for development now. No reason for this to be postponed.
Comment #13
andypostdoes not fits in beta
Comment #29
quietone commentedComment #30
quietone commentedformatting of ccs is checked automatically now. I am closing this as outdated.
Comment #31
quietone commentedSorry, wrong issue.
Comment #32
quietone commentedThe Contact Module was approved for removal in #3476879: [Policy] Move Contact module to contrib.
This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
The deprecation work is in #3520460: [meta] Tasks to deprecate the Contact module and the removal work in #3520466: [meta] Tasks to remove Contact module.
Contact will be moved to a contributed project after the Drupal 12.x branch is open.
Comment #34
andypost