Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Here is the confo email php im using. It works great! The only issue is for "when_should_we_expect_you this is a date component and it shows up in the confo email as "array" is there a way to have it see mmddyyyy? Im a bit lost on this one.
$to = $form['submitted']['email_address']['#value'];
$first_name = $form_values['submitted_tree']['first_name'];
$last_name = $form_values['submitted_tree']['last_name'];
$phone_number = $form_values['submitted_tree']['phone_number'];
$booking = $form_values['submitted_tree']['booking'];
$when_should_we_expect_you = $form_values['submitted_tree']['when_should_we_expect_you'];
$which_time = $form_values['submitted_tree']['which_time'];
$from = "reservations@xxxxxxxxxxxxxx.com";
$body = "Dear " . $first_name . " " . $last_name . ", \n\n
Thank you for reserving a tour for " . $booking . " on " . $when_should_we_expect_you . " at " . $which_time . " \n
In case you don't turn up we will call you at " . $phone_number . " \n\n
Kindest regards,\n
";
$message = drupal_mail('webform_extra', 'reply', $to, language_default(), array('body' => $body), $from, TRUE);
function webform_extra_mail($key, &$message, $params) {
$message['subject'] = "Tour Conformation from xxxxxxxxxxxx.";
$message['body'] = $params['body'];
}
Any help appreciated!
David
Comments
Comment #1
quicksketchYou should be theming your e-mails as recommended in THEMING.txt rather than using the additional submit code field. Providing help with custom PHP code is outside the scope of what support is provided in the Webform issue queue.
Comment #2
rankinstudio CreditAttribution: rankinstudio commentedI am just following the instructions for webform found here. Im not themimg the default email, this is a "Webform Additional Submission Snippets" provided here
http://drupal.org/node/323666
Just wondering why the date wont work right.
David
Comment #3
djalloway CreditAttribution: djalloway commentedIf
$form_values['submitted_tree']['when_should_we_expect_you']
is indeed a Date component then it typically would show up as an array because that is how Webform stores the data for a Date component.You have the Month, Day and Year stored in array format, so....
Comment #4
rankinstudio CreditAttribution: rankinstudio commenteddjalloway,
Thank you! Im really new to php. Really appreciate it :)
Cheers,
David
Comment #5
madlee CreditAttribution: madlee commentedthanks. I was using month day and year instead of the array numbers.
Comment #6
quicksketch