It would be great if you could choose whether a form element was included in an email. That way you could prevent sensitive information from being sent via email but the site admin would still get an email with some info in it and a link to view the rest.

Comments

djalloway’s picture

agreed, this would be a VALUABLE feature

Conceptually it doesn't sound that difficult to do either, I just wish I knew more about coding to be able to give it a shot myself.
Ideally you'd have another checkbox on the component page that you could check to "Include in Email Submission" or something to that extent.

quicksketch’s picture

Sounds reasonable (and even easy enough) to include as a feature. It'd be great to just have a checkbox just like the "Mandatory" checkbox on the overview page to include components in the e-mail or not.

quicksketch’s picture

Status: Active » Needs review
StatusFileSize
new11.91 KB
new32.3 KB

Here's a fully working patch for the 5.x branch. It requires a database update to add the new "email" column to the webform component table. Please give a try! I'll port it to 6.x after this has been tested for 5.x.

will_in_wi’s picture

I would suggest a different approach. What about allowing the admin to create a custom email that uses the token module to insert not only what he/she wants but also where.

My use case is a church website where I have a webform as a VBS signup sheet. When a user signs up, I want to email a nicely formatted message containing useful information. This requires not only filtering out unneeded fields, but also rearranging the whole email.

quicksketch’s picture

will_in_wi, I'd like to avoid that approach because it'd require the user to always "theme" the email every time they add a new field. If you want to configure the e-mail with a layout, you can already override the theme_webform_mail function. In Drupal 6 this will likely be converted to a tpl.php file to make the process easier.

will_in_wi’s picture

I think you can do this in an elegant way without requiring the user to retheme everytime a field is added. Add a multiline textbox that is collapsed by default. If the admin modifies this textbox, they can retheme the email, but they would have to modify it to add a new field. If the textbox is blank then the current method is used which would automatically add the field to the email. I think this would provide a good balance.

I use garland and other stock themes on the few sites I use, and I attempt to keep patches down to a minimum. I do not think I can modify a single form without modifying the theme. Also, if I train another admin who is capable of creating webforms, but is not capable of modifying php, they cannot modify a stock email.

If there is a simple way to do this that does not involve modifying a theme (for the reason stated above) or creating a module (I have done this, but it would be a pain for every form, and quite impossible for john q. webadmin), I would really appreciate knowing.

quicksketch’s picture

I'll have to hear from djalloway. As he's sponsoring the feature. It's implemented now as the issue describes. Providing a built-in template editor for e-mails is a different scenario.

will_in_wi’s picture

StatusFileSize
new6.21 KB

Here is a patch for the feature I am talking about. It is complete except for a modification of all of the theming components to just output the value and not the name: value.

I don't know if this is the best way to do this. I would really appreciate constructive criticism. Should I open a new issue for this patch?

UnicornSong’s picture

Thank you quicksketch you are a legend!

quicksketch’s picture

Status: Needs review » Fixed

I went ahead and applied to both the Drupal 5 and 6 versions of Webform 2.x. You should be able to download the development version shortly (it usually takes a day) that includes the new feature, or just checkout from CVS. Please re-open this issue with any problems you experience.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

Breen’s picture

I know this is a closed issue, but would this feature allow the line ""The results of this submission may be viewed at:" to be removed from the webform email?