almost 11 years ago
*It's simple to send custom emails in magento by using zend mail function with success and error messages see the following code *
public function postAction() { $params = $this->getRequest()->getPost(); $recipient = Mage::getStoreConfig('trans_email/ident_general/email'); //echo $recipient; //die(); if($params) { $mail = new Zend_Mail(); $mail->setBodyText( "Restaurant Name:".$params['restName']. "\nFirst Name:".$params['first_name']. "\nLast Name:".$params['last_name']. "\nCity:".$params['city']. "\nPhone No.:".$params['phone_no']. "\nEmail:".$params['email']. "\nNeed Help:".$params['help']. "Comments".$params['comments'] ); $mail->setFrom($params['email'],$params['first_name'].' '.$params['last_name']); $mail->addTo($recipient, ''); $mail->setSubject('New Contact'); try { $mail->send(); if($mail->send()){ $message = $this->__('Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us.'); Mage::getSingleton('core/session')->addSuccess($message); $this->_redirect('*/*/');} else { $message = $this->__('Unable to submit your request Please try again later'); Mage::getSingleton('core/session')->addError($message); $this->_redirect('*/*/'); } } catch(Exception $ex) { $message = $this->__('Unable to submit your request Please try again later'); Mage::getSingleton('adminhtml/session')->addError($message); } } else { $message = $this->__('Unable to submit your request Please try again later'); Mage::getSingleton('core/session')->addError($message); $this->_redirect('*/*/'); } }
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Sign up using
0 Comment(s)