fl3pp / PicoMailForms

An extension for Pico which allows you to define forms in markdown and send mails
The Unlicense
4 stars 2 forks source link

PicoMailFormsPlugin

PicoMailForms is a plugin for Pico which allows you to define a form and send a mails to a configured smtp server on submitting.

Forms can be written entirely in Markdown using custom markdown extensions. The mail is then being sent using PHPMailer.

PicoMailForms has been developed keeping CleanCode in mind. Unfortunately I'm not very familiar with PHP and the UnitTest coverage is therefore low. The IntegrationTest coverage reaches 98%.
Pull requests are welcome!

Use cases

Features

Installation

Install the plugin using composer: composer require jflepp/picomailformsplugin.

Small Example

Configuration

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

Form

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

Operator Mail

A user has successfully filled your form: test

mailexample@customer.com
first_nameHans
last_nameZimmer
some_other_informationThis is me

Full configuration

Configuring PicoMailFormsPlugin is straight forward.

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

Forms:
    UseBootstrap: true

Full form

[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]