疑难解答 马真托联系表.


Troubleshooting Magento Contact Form

我们的联系表格已停止工作,我不确定问题是什么。我可以确认其他电子邮件是否正常工作。奇怪的是,一旦我单击提交,它就会返回我http://mydomain.com/contact/index/并且没有消息。此外,如果测试邮件看起来是垃圾邮件,Akismet将在Akimet部分捕获它。这是我的设置:

带表单的页面:

{{block type="core/template" name="contactForm" form_action="/contacts/index/post/" template="contacts/form.phtml"}}

表单.html代码:

<form action="<?php echo $this->getFormAction();?>" id="contactForm" method="post">
<div class="fieldset">
    <h2 class="legend"><?php echo Mage::helper('contacts')->__('Contact Information') ?></h2>
    <ul class="form-list">
        <li class="fields">
            <div class="field">
                <label for="name" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Name') ?></label>
                <div class="input-box">
                    <input name="name" id="name" title="<?php echo Mage::helper('contacts')->__('Name') ?>" value="<?php echo $this->htmlEscape($this->helper('contacts')->getUserName()) ?>" class="input-text required-entry" type="text" />
                </div>
            </div>
            <div class="field">
                <label for="email" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Email') ?></label>
                <div class="input-box">
                    <input name="email" id="email" title="<?php echo Mage::helper('contacts')->__('Email') ?>" value="<?php echo $this->htmlEscape($this->helper('contacts')->getUserEmail()) ?>" class="input-text required-entry validate-email" type="text" />
                </div>
            </div>
        </li>
        <li>
            <label for="telephone"><?php echo Mage::helper('contacts')->__('Telephone') ?></label>
            <div class="input-box">
                <input name="telephone" id="telephone" title="<?php echo Mage::helper('contacts')->__('Telephone') ?>" value="" class="input-text" type="text" />
            </div>
        </li>
        <li class="wide">
            <label for="reason" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Reason') ?></label>
            <div class="input-box">
                <textarea name="reason" id="reason" title="<?php echo Mage::helper('contacts')->__('Reason') ?>" class="required-entry input-text" cols="5" rows="3"></textarea>
            </div>
        </li>
    </ul>
</div>
<div class="buttons-set">
    <p class="required"><?php echo Mage::helper('contacts')->__('* Required Fields') ?></p>
    <input type="text" name="hideit" id="hideit" value="" style="display:none !important;" />
    <button type="submit" title="<?php echo Mage::helper('contacts')->__('Submit') ?>" class="button"><span><span><?php echo Mage::helper('contacts')->__('Submit') ?></span></span></button>
</div>
</form>
<script type="text/javascript">
//<![CDATA[
var contactForm = new VarienForm('contactForm', true);
//]]>
</script>

以下是系统的内容.log:

2012-08-10T18:21:51+00:00 ERR (3): Notice: Undefined index: comment  in /var/www/html/svn/magento/website/trunk/app/code/community/Centerax/Akismet/Model/Api.php on line 56
2012-08-10T18:21:51+00:00 ERR (3): Notice: Undefined index: comment  in /var/www/html/svn/magento/website/trunk/app/code/community/Centerax/Akismet/controllers/Contacts/IndexController.php on line 52

修复了。在某些时候,我将"注释"的默认字段更改为"原因",如您在上面的代码中看到的那样。Akismet抛出了一个错误,因为它找不到"评论"来检查垃圾邮件。无论如何,谢谢大家。