验证和电子邮件不工作OctoberCMS

问题描述 投票:1回答:1

My issue:

我运行在Azure上OctoberCMS,我尝试使用“魔表单”插件十月。我使用的是通用的形式,并将它成功提交,并在后台被显示。

我的问题是,我想发送电子邮件通知,当一个表单提交,我有STMP设置和测试消息正确地发送,但什么也没有发生在提交。

我的另一个问题是,没有任何验证或JsOnSuccess被触发。

一些我试过的东西:

  • 我已经把我自己的规则和我自己的规则消息名称字段,但什么都没有改变。
  • 我已经试过所有硬编码的电子邮件详情,仍然不发送电子邮件,即使测试消息的工作。

我的表单代码:

[viewBag]
snippetCode = "formAccountingServices"
snippetName = "Form Accounting Services"

[emptyForm formAccountingServices]
group = "Accounting-Services"
rules[name] = "required"
rules[email] = "required|email"
rules[phone] = "required"
rules[service] = "required"
rules[message] = "required"
messages_success = "Your form was successfully submitted"
messages_errors = "There were errors with your submission"
mail_enabled = 1
mail_subject = "Test Subject"
mail_recipients[] = "[email protected]"
mail_replyto = "[email protected]"
reset_form = 1
redirect = "https://myHomeUrl.com"
inline_errors = "display"
js_on_success = "window.location.href = 'http://stackoverflow.com;'"
sanitize_data = "disabled"
anonymize_ip = "disabled"
recaptcha_theme = "light"
recaptcha_type = "image"
recaptcha_size = "normal"
==
<form data-request="{{ formAccountingServices}}::onFormSubmit">

{{ form_token() }}

<div id="{{ formAccountingServices }}_forms_flash"></div>

<div class="form-group">
    <label for="name">Name:</label>
    <input type="text" id="name" name="name" class="form-control">
</div>

<div class="form-group">
    <label for="email">Email:</label>
    <input type="text" id="email" name="email" class="form-control">
</div>

<div class="form-group">
    <label for="phone">Phone:</label>
    <input type="text" id="phone" name="phone" class="form-control">
</div>

<div class="form-group">
    <label for="service">Service of interest</label>
    <select name="service" id="service" class="form-control">
      <option value="Accounting Services">Accounting Services</option>
      <option value="Legal Services">Legal Services</option>
    </select>
  </div>

<div class="form-group">
    <label for="message">Message</label>
    <textarea id="message" name="message" rows="8" cols="80"></textarea>
</div>

<button id="simpleContactSubmitButton" type="submit" class="btn btn-default">Submit</button>

</form>

Expect results:

  • 我希望所有的字段是必需的,如果某些字段为空不允许提交。
  • 在成功提交表单就会发送通知邮件到一组电子邮件地址和重定向到主页。
  • 在成功提交显示错误消息。

Actual results:

  • 表单将提交场是空的,或者不是每次都不管。
  • 没有通知发送电子邮件。
  • 页面不重定向。
laravel octobercms octobercms-plugins
1个回答
1
投票

您是否使用了自定义的主题?魔术形式明确地使用AJAX。请确保您{%的骨架额外%}之前已经jQuery的加载,我不记得,如果它需要{%脚本%}与否。

一个更好的地方,寻求这种帮助也可能是插件https://github.com/skydiver/october-plugin-forms GitHub的。

© www.soinside.com 2019 - 2024. All rights reserved.