Leaving out empty fields in D7 Webforms email

Events happening in the community are now at Drupal community events on www.drupal.org.
jrperry's picture

I was trying to find some form of documentation on how to leave out empty fields in the email form. I tried several variations and they all threw errors or left out the incorrect fields. I'm using Webforms on D7, so if anybody can lead me in the right direction, it would be appreciated. All of the fields that can be left out if blank are textareas if that helps. Here are the pages I looked at previously:

http://drupal.org/node/705004
http://drupal.org/node/347361

Comments

Implement a webform hook

rlhawk's picture

I'd implement either hook_webform_submission_presave or hook_webform_submission_insert. Cycle through the elements in $submission->data. If any components are empty, add them to $node->webform['emails'][NUM]['excluded_components'].

Seattle

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: