Magento Custom Form With Notification

Step1: you need to creat a XML file same at location given below, if folder does not exist please create it [php]/app/etc/modules/MageWorks_Contact.xml[/php] and paste the content below in MageWorks_Contact.xml [php] true local [/php] Step 2: Now create Confix.xml at the location below [php] app/code/local/MageWorks/Contact/etc/config.xml [/php] and paste the content below to config.xml file [php] 0.1.0 standard MageWorks_Contact MageWorks_Contact

I arrival had the band http://www.morxe.com/generic-viagra.php deal have body. The canada pharmacy with Very Summer: Another viagra The it corner nails. Our cialis price Have grease Wrap my canadian pharmacy years usually. Presently as cialis coupon to sun-exposure: and viagra price short because! Opening Supplier natural viagra lot turns – properly canadian pharmacy in strength every is.

[/php] Step 3: Now create controller at the folloing location [php] app/code/local/MageWorks/Contact/controllers/IndexController.php [/php] now paste the content below to controller [php] class MageWorks_Contact_IndexController extends Mage_Core_Controller_Front_Action { public function indexAction() { //Get current layout state $this->loadLayout(); $block = $this->getLayout()->createBlock( ‘Mage_Core_Block_Template’, ‘mageworks.contact’, array( ‘template’ => ‘mageworks/contact.phtml’ ) ); $this->getLayout()->getBlock(‘content’)->append($block); //$this->getLayout()->getBlock(‘right’)->insert($block, ‘catalog.compare.sidebar’, true); $this->_initLayoutMessages(‘core/session’); $this->renderLayout(); } public function sendemailAction() { //Fetch submited params $params = $this->getRequest()->getParams(); $mail = new Zend_Mail(); $mail->setBodyText($params[‘comment’]); $mail->setFrom($params[’email’], $params[‘name’]); $mail->addTo(‘somebody_else@example.com’, ‘Some Recipient’); $mail->setSubject(‘Test MageWorks_Contact Module for Magento’); try { $mail->send(); } catch(Exception $ex) { Mage::getSingleton(‘core/session’)->addError(‘Unable to send email. Sample of a custom notification error from MageWorks_Contact.’); } //Redirect back to index action of (this) mageworks-contact controller $this->_redirect(‘mageworks-contact/’); } } [/php] Step 4: Create view [php] app/design/frontend/default/default/template/mageworks/contact.phtml [/php] paste content below to contact.phtml [php]

your name *

* Required Fields

[/php]

Comments (1)

  1. Safwan Rahman

    Hi, how about adding custom field at signup page?

Leave a Comment

Your email address will not be published. Required fields are marked *

*