Wow, it seems that Drupal's Webform module has come a long way since I last used it (which I believe was Drupal 5.x). It's so convenient and really latches onto the new template hints and stuff from Drupal 6 (here I am talking about it while Webchick announced yesterday the D7 criticals queue is under 200, w00t!).
We had a use case where we wanted to send an email from our web site--on behalf of someone--to someone else. You've seen these around in the political world, "send a note to Congressman blah blah and tell him to STOP lobbying for the use of plutonium as a dietary supplement!" We're hosting a site for a cause, but we're trying to facilitate our constituency sending an email to someone else.
Turns out webform handles this quite well. You fill out a form, and you can specify who to send mails to. We've set the main "send a copy to" to the site administrator, who wants a copy of all mails. We've then set to webform components for the two other emails. One of the components is the sender's email, and another is a hidden webform field which contains the recipient's email.
All the pieces were coming together nicely, except the email coming out was pretty default. I started digging for themeable emails, and turns out, it was already hooked in. Genius. Not JUST that, but with a template hint for the node id, you can even theme the emails just for a particular webform, so you don't have to trash all webforms.
I took webform-mail.tpl.php and copied it into my theme folder, then copied that over to webform-mail-116.tpl.php (as my node ID for this webform was 116). I could then remove the default theme calls, and print out a templated message just containing the barebones information so it looks just like a regular email.
This whole process took me 20 minutes... bonzer!
Chris, Just seeing this now.
Chris,
Just seeing this now. I'm guessing that you're much farther into the webform world now, and have no doubt you're far more capable with drupal than I. I'm wondering if you know how to dynamically show/hide sections in drupal based on selections of other visible controls, say, a checkbox for example. I know this should be doable with jquery, but any ideas on how to handle this with a webform?
Thanks in advance for your help.
Jamie V
Jamie - I believe Webform
Jamie - I believe Webform Conditional might be what you're looking for?
http://drupal.org/project/webform_conditional
I'm trying to figure out how
I'm trying to figure out how to pass the page that the webform is on back to the template, arg(1) didn't work, I'll print_R and see what we have.
Post new comment