Just created a quick and dirty custom module: Contact Override.
I posted it on bitbucket: bitbucket.org/_vid/contact_override
Nothing too exciting, just an override to the D6 contact form. It appends the senders email into the body of the email.
We had noticed that while emails from the Drupal contact form contained the senders email in the reply field that email address was often lost when forwarding the message.
Here’s the readme:
Contact Override: Use hook_mail_alter to add the sender’s email address to the body of the email.
- Vid Rowan (_vid)
- Drupal 6
The contact_override module is a simple custom module that adds the senders email to the body of the contact page message. For example, the standard email message would be appended with this:
– Mail sent out from Drupal on behalf of firstname.lastname@example.org.
- Note: ‘Drupal’ is substituted with the site_name if set.
- It was noticed that while emails from the Drupal 6 contact form contained the senders email in the reply field that email address was often lost when forwarding the message.
For example when an email is received from the ‘Test Site’ contact form the reply line may look like this:
From: email@example.com on behalf of Vid < firstname.lastname@example.org >
When that message is forwarded the email address in the brackets is lost in the body of the message, like so:
—–Original Message—– From: email@example.com [mailto:firstname.lastname@example.org] On Behalf Of Vid
This module adds that line to the message body to work around this issue. So now we would see this at the end of the email:
– Mail sent out from Test Site on behalf of email@example.com.
Scope: What this module does
- Uses hook_mail_alter to add content to the body of the email
Out of Scope: What this module does not do
- This module does not have an admin settings page
- Ref: http://api.drupal.org/api/drupal/includes!mail.inc/function/drupal_mail/6
- Ref: http://api.drupal.org/api/drupal/developer!hooks!core.php/function/hook_mail_alter/6
- General info: https://bitbucket.org/_vid/contact_override
- Clone ssh: firstname.lastname@example.org:_vid/contact_override.git
- Clone http: https://email@example.com/_vid/contact_override.git
- General info: https://git.uoregon.edu/projects/UO_DRPL_PROD/repos/contact_override/browse
- Clone ssh: ssh://firstname.lastname@example.org/UO_DRPL_PROD/contact_override.git
- Clone http: http://email@example.com/scm/UO_DRPL_PROD/contact_override.git
- Install module as usual, see [Installing contributed modules](http://drupal.org/node/70151 for further information.
- Enable the module. Once enabled the body of the contact page template will be modified.
Git.uoregon.edu Repo Notes:
- The master branch can only be written to by Vid.
- Feel free to create new branches and push them up. The dev branch can be written to by anyone.