Skip to content

Instantly share code, notes, and snippets.

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.
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';
Copy link

stuartATP commented Jan 26, 2021

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