Skip to content

Instantly share code, notes, and snippets.

@postrational
Created June 12, 2013 20:24
Show Gist options
  • Save postrational/5768796 to your computer and use it in GitHub Desktop.
Save postrational/5768796 to your computer and use it in GitHub Desktop.
Drupal 7 - Redirect your users to a custom page after sending a message using site wide contact forms Place the following code in the template.php file of you theme.
<?php
function my_theme_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'contact_site_form') {
$form['#submit'][] = 'contact_form_submit_handler';
}
}
function contact_form_submit_handler(&$form, &$form_state) {
$form_state['redirect'] = 'thank-you-page-alias';
}
@stuartATP
Copy link

Hi. Could I ask a question about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment