New Marketing Campaign
Just for fun.
What is Prairiehippo?
Prairiehippo is thin.
Prairiehippo is beautiful.
Prairiehippo goes everywhere and LASTS all day.
There is no right way or wrong way.
Prairiehippo is CRAZY powerful.
Prairiehippo is magical.
You already know how to use Prairiehippo.
It’s 200,000 lines of code and counting.
All the worlds websites in his hands
Prairiehippo is PHP, SQL, more skills then you can imagine
Prairiehippo is already a revolution, and I’ve only just begun.
After spending a couple hours trying to figure out the best way to send a confirmation email after a submission using the Webform Module, I came upon the solution here: http://drupal.org/node/323666#comment-1119996
The code that ended up working for me was as follows (many thanks to grendzy):
$to = $form['submitted']['email']['#value'];
$from = variable_get('site_mail', '');
$body = drupal_html_to_text($node->webform['confirmation']);
$message = drupal_mail('webform_extra', 'reply', $to, language_default(), array('body' => $body), $from, TRUE);
function webform_extra_mail($key, &$message, $params) {
$message['subject'] = "Thanks for your interest.";
$message['body'] = $params['body'];
}This code gets inserted into the “Additional Processing” field on the webform’s edit page. Any code placed in this field will be executed upon form submission.
Not every form is built the same, but in the case above it is looking to fill the $to variable with a value submitted as part of the form. The value it’s looking for is called ‘email’ and can be found within the $form['submitted'] variable. In the case that I had to implement, the email variable was placed inside a fieldset called ‘contact_information’, leaving the value I needed to reference:
$to = $form['submitted']['contact_information']['email']['#value'];To dig out the proper method to reference these variables, I simply printed out the $form array and placed and exit() call. Looking at the page source allowed me to see the entirety of the $form object. Some people use the Devel module and subsequently use the dsm() function to accomplish the same thing.
Attending Drupal Camp Alberta
Down in Lethbridge Alberta to attend this years Drupal Camp Alberta. Looking forward to meeting other people and learning what can be done with the Drupal platform.
Looks like a good line up of presentations, check it out here: http://drupalcampalberta.org/
The big thing I’m going to be looking for is ways to improve the end user experience of a basic Drupal site. My experience is that this is a big area that should be improved with the basic Drupal installation. Also looking for some best practices and other tips and tricks.
Will be great to meet other relatively local developers with experience in Drupal. So far, I’m the only one I’ve met in Calgary that has actively worked with the platform.
