Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.