I would like to use webform as a gateway that allows my site visitors to submit email to my trouble ticketing desk (fyi, I use Cerberus Helpdesk). This will prevent spammers from getting hold of the email address.

However, out of the box, webform generates an email that has my site address as the "from" email and the name of the webform node as the subject.

I wish I could have a mandatory email field become the from address, and a mandatory subject line become the subject line.

I might be willing to take a stab at it, with some guidance.

Overall, though, I really like webform. Thank you for making it!

Cheryl

CommentFileSizeAuthor
#4 webform.module_0.txt40.57 KBjnt
#3 webform.module.txt39.36 KBjnt
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jnt’s picture

Hi please advise if you are still looking at this and whether you have done anything.

It looks pretty straightforward however I have some concerns that it might allow webform to be used for spam.

Also, please confirm my understanding of the application:

  1. users will submit a webform on a drupal site
  2. webform will notify your ticketing system that a new webform has been submitted but you do not want:
    • a drupal site return email on that notification
    • a link back to the new data

Given this scenario, the email is between webform and the ticketing system, I am not sure where spammers are going to get hold of it.

Please advise,

cherylchase’s picture

Hi JNT,

1. users will submit a webform on a drupal site

That's correct.

2. webform will notify your ticketing system that a new webform has been submitted but you do not want:
* a drupal site return email on that notification
* a link back to the new data

I'm not sure I understand what you are asking. The only changes from the 4.5 release that I am requesting are:

a. that I be able to place an "email" field on the form, and the webform use that email address as the email's "from" address.

b. THat I be able to place a "subject" line on the form, and the webform use that as the email's subject.

This doesn't increase the risk of spam, because the person filling out the form has no view of or control over the email address to which the form is mailed. (Indeed, that is the only reason why I want to use webform rather than allowing visitors to send email with an ordinary email client).

jnt’s picture

FileSize
39.36 KB

No, the bit I can't understand is how being able to change the from address will protect the creator from spammers, given that it is they are nominating the recipient anyway.

Try this patch and see if it is what you want. One warning, it will lazy create two extra fields in your webform table without alert, specifically:

  • email_from,
  • email_subject

This will not affect you if you don't like it and want to revert to your existing webform.module except by making the database slightly inneficient. You can manually drop these fields for the database if you like.

This patch is not in cvs so it is not directly supported until ullgren gets back and decides whether he wants to go this way or not. I have only tested it on MySQL.

It is not required to upload my webform.inc patches as they only affect the analysis functions. But you can if you like, all feedback is welcome.

You must of course drop the '.txt' to rename the patch to just 'webform.module'. Make sure you backup your existing webform.module.. etc etc..

jnt’s picture

FileSize
40.57 KB

Hi,

Here is another cut that uses a different paradigm. I put this one forward because it satisfies both types of requests for email configuration.

Instead of simply hand-crafting a 'subject' and 'email from' address as the previous one permitted, this one allows you to nominate components within the form body as the source for these data. If you want to, you can still completely hand craft with form wildcards onto a hidden component and select this as the source. The user is not involved. Otherwise you nominate which visible component sources the data. This way both functionalities are achieved.

It also has the additional advantage of persisting the input as normal data within the body of the form.

The selection as to which component provides the data is made by the form designer on the edit page.

The list of possible 'email from' fields is composed of all email type components and all hidden type components on the form and a default (Current automatic).

The list of possible 'subject' fields is composed of all textfield type components and all hidden type components on the form and a default (Current automatic).

No validation is done as yet on email or subject fields other than tag stripping for security.

See what you think, feedback please.

Anonymous’s picture

Brilliant!! That does *exactly* what I want. Thankyou!!!
Is it possible to tidy up the body of the email a bit. It is full of HTML tags and stuff.

jnt’s picture

I'll make this a separate issue. As a workaround until there is a patch, you may be able to set your email client to render HTML.

ullgren’s picture

Pacthed CVS.
Also removed problems with html chars in email.

ullgren’s picture

WeRockYourWeb.com’s picture

Version: » 4.7.x-1.2

Whatever happened to this patch? I'm using the current version of webform two years later and it lacks this functionality. My guess is that it was a security/ spamming concern? If not, I think it would be great to add this back in.

Cheers,
Alex

WeRockYourWeb.com’s picture

Version: 4.7.x-1.2 » 4.7.x-1.x-dev
Category: feature » bug
Status: Closed (fixed) » Postponed (maintainer needs more info)

I just noticed that this functionality appears to be in the works in the dev branch. I updated my webform module but can't get the functionality to work (having the form appear to be sent by the "email" field). Is this still in development? Can I contribute or is this already supposed to work and my system is being goofy?

WeRockYourWeb.com’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

It appears that the latest 4.7 dev branch simply has the "name/ address" fields interchanged. Either way, I downgraded to webform v1 and now I'm able to set the "From:" to an email field. Looks like most development is on the 5 branch now anyways. I'll finally be joining that bandwagon soon as important 4.7 modules stabilize for 5.x.

:)