Contact Form

From Foundation
Jump to navigation Jump to search

Foundation Contact Form

Foundation comes with secure working contact functionality, including a form validator. This feature in ready-made and available with minimal customization. See it working.

Set up

1. Choose the page you want to add your contact form to, and add to this page;

<htmlet>contact</htmlet>

2. Open to edit extensions/Foundation/contact.php and modify to suit your email;

// an email address that will be in the From field of the email.
$from = 'Foundation contact form <support@foundationextension.com>';

// an email address that will receive the email with the output of the form
$sendTo = 'Foundation contact form <support@foundationextension.com>';

And the following to suit your wiki success and error pages.

    header('Location: https://foundationextension.com/index.php?title=Success');
}
else {
    //error redirect
    header('Location: https://foundationextension.com/index.php?title=Error');

3. Create the Success and Error pages on your wiki.

4. Move contact.php to your wiki root (same location as LocalSettings.php).

5. Test your form

Potential Problems

If you find the form doesn't work, it's probably because you've not set up SMTP for your wiki, in which case see here for information on how to do this.



TOP

Retrieved from ‘https://foundationextension.com/index.php?title=Contact_Form&oldid=622