duancong2160 2015-11-13 13:54
浏览 17

Magento定制联系表

I have created a separate contact form, this form sends the info collected to an email, collecting the data seems to be working, sending the email as well... but the info collected is not sent to the email, i'm only getting static content as test but the info collected is missing, i've tried different things, here's my code in the controller, i commented each method used.

    <?php 
class Yo_Wholesaleform_IndexController extends Mage_Core_Controller_Front_Action{
    public function indexAction(){ 
        $this->loadLayout();
        $this->_initLayoutMessages('core/session'); 
        $this->renderLayout();
    }
    public function sendAction(){
        $post = $this->getRequest()->getPost();
             //i've tried this method
        $company_name = trim($post['company_name']);
             //also this method
        $company_name = $post['company_name'];
        $first_name = $post['first_name'];
        $last_name = $post['last_name'];
        $fullName = $first_name." ".$last_name;
        $formcontent = " From: $fullName 
        
 Company: $company_name
        
 Email: $email"; //here 
        $recipient = "alex@nalashandmade.com";
        $subject = "Wholesale Account Request";
        $mailheader = "From: $email 
";
        mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");


        Mage::getSingleton('core/session')->addSuccess($this->__('Thanks for submitting your Wholesale Account Request. Allow us 48 hours to review your information.'));//add success message.
        $this->_redirect('*/*');
    }
}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 ETLCloud 处理json多层级问题
    • ¥15 matlab中使用gurobi时报错
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭
    • ¥15 2020长安杯与连接网探
    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
    • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
    • ¥15 可见光定位matlab仿真
    • ¥15 arduino 四自由度机械臂
    • ¥15 wordpress 产品图片 GIF 没法显示