jflepp/picomailformsplugin

为Pico设计的表单邮件插件

安装: 133

依赖项: 0

建议者: 0

安全: 0

星标: 4

关注者: 2

分支: 2

开放问题: 0

类型:pico-plugin

0.0.18 2018-11-28 07:22 UTC

This package is auto-updated.

Last update: 2024-09-28 23:56:44 UTC


README

PicoMailForms是一个为Pico设计的插件,允许您在提交时定义表单并发送邮件到配置的SMTP服务器。

表单可以使用自定义Markdown扩展完全用Markdown编写。邮件将通过PHPMailer发送。

PicoMailForms的编写考虑到了CleanCode,遗憾的是我不是很熟悉PHP,因此单元测试覆盖率较低。集成测试覆盖率达到了98%。
欢迎Pull requests!

使用场景

  • 注册表单
  • 联系表单
  • 等等...

特性

  • 表单Markdown扩展
  • 表单提交后的成功/错误页面
  • 操作员邮件
  • 自定义成功/错误消息
  • Bootstrap表单
  • 错误邮件发送给管理员
  • 98%测试覆盖率

安装

使用composer安装插件:composer require jflepp/picomailformsplugin

小示例

配置

Mail:
    SenderName: test.ch
    Host: server.test.ch
    UserName: test@test.ch
    Password: test
    Port: 587
    OperatorMail: testuser@test.ch

表单

[form]
  [text mail]E-Mail[/text]
  [text]some other information[/text]
[/form]

操作员邮件

一个用户已成功填写您的表单:测试

完整配置

配置PicoMailFormsPlugin很简单。

Mail:
    SenderName: MyWebsite
    Host: smpt.myprovider.com
    UserName: web@myprovider.com
    Password: apassword
    Port: 587
    OperatorMail: iamtheoperator@myprovider.com

Forms:
    UseBootstrap: true

完整表单

[form]
    [subject]Registration for event XY[/subject]
    [success]You successfully registered for the event XY! You're going to receive more information asap[/success]
    [failed]Registration failed. The site administrator has already been informed.[/failed]
    [text mail required]Mail[/text]
    [text firstname]First name[/text]
    [text lastname]Last name[/text]
    [text]Address[/text]
    [text]Other informations[/text]
    [textarea required]Message[/textarea]
[/form]
  • [form] 表单的开始/结束。表单之间所有的数据将被解析或丢失
  • [success] 定义在网页和邮件中显示的成功消息
  • [failed] 当邮件失败时在页面上显示的失败消息
  • [text] 将被转换为文本输入,输入之间的文本将用作标签
  • [text required] 为输入添加必填
  • [text mail] 一个普通的文本输入,表示PicoMailForms这个位置是用户指定的电子邮件。您可以使用任何标签。这是表单中唯一必填的字段。
  • [text firstname][text lastname] 用户的姓名和姓氏。它将被设置为用户邮件的接收者名称。
  • [textarea] 定义文本区域