Magento Forum

   
Contact Form
 
ad2joe
Member
 
Avatar
Total Posts:  60
Joined:  2007-08-31
 

Hello,

Any chance somebody has already created a Contact Us Module? Or maybe there is something similar ready from Magento Team smile
I tried to build one following the user registration, but I stopped after making the template and controller.

Thanks, Joe.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ad2joe
Member
 
Avatar
Total Posts:  60
Joined:  2007-08-31
 

Hello,

The idea is to make a contact_us module. I’m thinking using the registration as example.
If Magento Team could give some tips, that would help a lot!
I’m planning to try and get it done over the weekend, and could use some help on creating this module.

Thanks, Joe.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ad2joe
Member
 
Avatar
Total Posts:  60
Joined:  2007-08-31
 

I feel this topic will get an useful reply very soon. smile

Thanks, Joe.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ad2joe
Member
 
Avatar
Total Posts:  60
Joined:  2007-08-31
 

Hello,

That is true, but still, some guidances of how to build such a module would be welcome.

Thanks, Joe.

 
Magento Community Magento Community
Magento Community
Magento Community
 
gabrielk
Sr. Member
 
Avatar
Total Posts:  83
Joined:  2007-11-30
 

If you wanted to deploy a “contact” form ASAP, create a new CMS page for “contact us” and input a standard HTML form.  Have it post to a custom form processing script that handles the email submit and then returns the user to whatever page you want.  e.g.:

<form action="/form_processing.php" method="post">
Name: <input  id="name" name="name" type="text" />
Email: <input  id="email" name="email" type="text" />
Comments: <textarea id="comments" name="comments" rows="6" cols="50"></textarea>
<
input id="button" name="Submit" type="submit" value="Submit" />
</
form>

form_processing.php

<?
if($_POST{
    
/* processing/email logic here */
    
$url 'http://www.mydomain.com/contact-success';
else {
    $url 
'http://www.mydomain.com/contact';
}
header
("Location: ".$url);

Very basic example.  You’ll want to use the built in javascript to pre-check the form for errors, validate the data on your form processing script, etc.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top