我们的联系表已停止工作,我不确定问题所在。我可以确认其他电子邮件是否正常工作。奇怪的是,一旦我点击提交,它就会将我返回http://mydomain.com/contact/index/
并且没有消息。此外,如果测试邮件看起来像垃圾邮件, Akismet 将在Akimet部分中捕获它。这是我的设置:
带有表单的页面:
{{block type="core/template" name="contactForm" form_action="/contacts/index/post/" template="contacts/form.phtml"}}
form.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>
以下是system.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
答案 0 :(得分:0)
修好了。在某些时候,我将'comment'的默认字段更改为'reason',正如您在上面的代码中看到的那样。 Akismet抛出一个错误,因为它无法找到“评论”来检查垃圾邮件。不管怎样,谢谢大家。