PHPackages                             bzcoding/bz-contact-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bzcoding/bz-contact-php

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

bzcoding/bz-contact-php
=======================

A simple contact form manager for static sites and landing pages

2.1.3(8y ago)013[1 issues](https://github.com/BZCoding/bz-contact-php/issues)MITPHPPHP ~5.6 || ~7.0

Since Sep 30Pushed 8y ago1 watchersCompare

[ Source](https://github.com/BZCoding/bz-contact-php)[ Packagist](https://packagist.org/packages/bzcoding/bz-contact-php)[ Docs](https://github.com/BZCoding/bz-contact-php)[ RSS](/packages/bzcoding-bz-contact-php/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (20)Versions (14)Used By (0)

BZContact PHP Form Manager
==========================

[](#bzcontact-php-form-manager)

[![Build Status](https://camo.githubusercontent.com/c79f28451ab017841cbb13d8b4b09bfd5f89536c3f48d1320a717d7e51f05a3f/68747470733a2f2f7472617669732d63692e6f72672f425a436f64696e672f627a2d636f6e746163742d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/BZCoding/bz-contact-php) [![Test Coverage](https://camo.githubusercontent.com/745f0642180aa8439b1b855ff7c1c5da87f2274e96d1f1adf085fda2dbfbe1d6/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f425a436f64696e672f627a2d636f6e746163742d7068702f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/BZCoding/bz-contact-php/coverage) [![Code Climate](https://camo.githubusercontent.com/7a75e99529f1b3589f693fc4227bff9c2f4d181a11961496789f5c8829fecaaa/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f425a436f64696e672f627a2d636f6e746163742d7068702f6261646765732f6770612e737667)](https://codeclimate.com/github/BZCoding/bz-contact-php)

**BZContact** is a simple contact form manager written in PHP. It can be used to manage a contact form for a static web site, or to create a landing page and collect call to action requests.

**This repo is meant to be forked** and customized to create your own contact form or landing page.

Features
--------

[](#features)

- A single landing page, with form processing and a "thank you" or error page
- A contact form structure defined by a JSON file
- Customizable Privacy and ToS pages
- Stores entries in MongoDB
- Sends notification emails to the admin
- Sends "thank you" emails to subscribers
- Integrates with MailChimp
- Integrates with Webhooks
- Simple default UI theme, easy to customize

Installation
------------

[](#installation)

### Deployment on Heroku

[](#deployment-on-heroku)

[![Deploy](https://camo.githubusercontent.com/3da7ea007288c7a8b14c8c84f0836d66ba8f82bd2f3b72fb7e0e72e19a16d28f/68747470733a2f2f7777772e6865726f6b7563646e2e636f6d2f6465706c6f792f627574746f6e2e706e67)](https://heroku.com/deploy?template=https://github.com/BZCoding/bz-contact-php/tree/master)

The deployment script will provision a web process and a worker process for background tasks.

The script will also provision free plans for the following add-ons: [MongoLab](https://elements.heroku.com/addons/mongolab), [Postmark](https://elements.heroku.com/addons/postmark), [CloudAMQP](https://elements.heroku.com/addons/cloudamqp), [Logentries](https://elements.heroku.com/addons/logentries) and [Rollbar](https://elements.heroku.com/addons/rollbar). If you already have paid plans on these services, or want to use other services, you can delete them and customize your configuration.

If you use the provided free version of Postmark you need to [create a sender signature](http://support.postmarkapp.com/category/45-category) or you will not be able to send email notifications.

### Installation on a Linux/macOS machine

[](#installation-on-a-linuxmacos-machine)

Run this command from the directory in which you want to install your new application:

```
$ composer create-project bzcoding/bz-contact-php [your-app-name]
```

Customize the form and the UI theme.

### Running in Development

[](#running-in-development)

- Rename `.env.example` to `.env` and enter your custom settings
- Start a development server by running `composer run server --timeout=0`

You may use the provided Vagrant box and Ansible settings, but be aware that they have been written for development only.

### Running in Staging and Production

[](#running-in-staging-and-production)

- Point your virtual host document root to the application's `app/public/` directory
- Copy the needed environment variables from `.env.example` into your virtual host file
- Ensure your log file path is web writeable if you're not logging to `stdout`.

### Configuration

[](#configuration)

In order to have a working instance of BZContact you need to provide the settings through environment variables. The following settings are required:

- `MAILER_*` for the SMTP server
- `DATABASE_*` for the MongoDB server
- `AMQP_*` for the queue server

While these others are optional:

- `NEWSLETTER_*` enables MailChimp integration
- `WEBHOOK_*` enables webhooks processing
- `REDIRECT_THANKYOU` uses a custom "thank you" page
- `ROLLBAR_ACCESS_TOKEN` enables Rollbar error tracking

Requirements
------------

[](#requirements)

- Apache or Nginx web server
- PHP 5.6 or better with MongoDB support (tested with `ext-mongo` on PHP 5.6, you need `ext-mongodb` with PHP 7)
- MongoDB server
- RabbitMQ or other AMQP compatible server
- An SMTP mail server (or [MailCatcher](https://mailcatcher.me/)) for development

The JSON Form object
--------------------

[](#the-json-form-object)

The form is loaded from a simple JSON object, with two top-level properties: `attributes` (object) and `fields` (array of field objects). Every field object must have at least a `name` or a unique `id` attribute, the default input type is `text`.

Supported field types are: `text` and `textarea`, `email`, `tel`, `select`, `checkbox`, `radio`, `submit`.

**Please note** that BZContact has been designed to be used with contact forms, a more complex form structure could lead to undesired results.

```
{
    "attributes": {
        "id": "frm-contact",
        "class": "contact-form",
        "accept-charset": "utf-8",
        "novalidate":"novalidate"
    },
    "fields": [
        {
            "id": "contact-name",
            "name": "name",
            "label": "Your name",
            "placeholder": "eg. John Appleseed",
            "required": true,
            "error": "Your name is a required field"
        },
        ...
        {
            "id": "contact-submit",
            "name": "saveForm",
            "type": "submit",
            "value": "Send message",
            "save": false
        }
    ]
}
```

The Webhook post format
-----------------------

[](#the-webhook-post-format)

The webhook feature is enabled by setting the `WEBHOOK_URL` environment variable to the desired destination URL.

The content of the form subscription is `POST`ed to the webhook URL with an `application/json` content type and a JSON body.

BZContact sends two custom headers:

- `X-Bzcontact-Event`: the object of the event (i.e `message`)
- `X-Bzcontact-Delivery`: the id of the submission

Optional custom headers can be added using the `WEBHOOK_HEADERS` env var, each header separated by a `|`: `WEBHOOK_HEADERS="X-Foo:123|X-Bar:xyz"`.

The JSON payload has the following format:

```
{
  "action": "saved",
  "created_at": "YYYY-MM-DD HH:MM:SS",
  "data": {
    "name": "John Doe",
    "company": "ACME Ltd",
    "email": "john@acme.com",
    "phone": "",
    "subject": "It's only Rock'n Roll...",
    "message": "but I like it!\r\n~M\r\n",
    "referral": "friends",
    "client-type": "business",
    "privacy": "1",
    "ip": "xxx.xxx.xxx.xxx",
    "datetime": "YYYY-MM-DD HH:MM:SS",
    "id": ""
  }
}
```

The `action` attribute contains the event type (only `saved` for now). The `data` object contains all the form fields the addition of the subscriber IP address, datetime and submission ID.

Credits
-------

[](#credits)

BZContact is built on top of Slim-Skeleton application. It uses Slim 3 Framework with the PHP-View template renderer.

The default UI theme built on top of [Skeleton](http://getskeleton.com/) CSS boilerplate, with a cover photo by [Yair Hazout from Unsplash](https://unsplash.com/@yairhazout).

The favicon and the application logo (`logo.svg`) were built using icons by [Freepik](http://www.freepik.com) from [Flaticon](http://www.flaticon.com), licensed by [CC 3.0 BY ](http://creativecommons.org/licenses/by/3.0/ "Creative Commons BY 3.0")

License
-------

[](#license)

BZContact is licensed under the MIT License - see the `LICENSE` file for details.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~31 days

Recently: every ~62 days

Total

12

Last Release

3215d ago

PHP version history (3 changes)2.0.0PHP &gt;=5.5.0

2.0.2PHP &gt;=5.6.0

2.1.1PHP ~5.6 || ~7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/539034?v=4)[Vito Tardia](/maintainers/vtardia)[@vtardia](https://github.com/vtardia)

---

Top Contributors

[![vtardia](https://avatars.githubusercontent.com/u/539034?v=4)](https://github.com/vtardia "vtardia (130 commits)")

---

Tags

formlanding page

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/bzcoding-bz-contact-php/health.svg)

```
[![Health](https://phpackages.com/badges/bzcoding-bz-contact-php/health.svg)](https://phpackages.com/packages/bzcoding-bz-contact-php)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k532.1M19.5k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[azuracast/azuracast

The AzuraCast self-hosted web radio station management suite.

3.9k27.8k](/packages/azuracast-azuracast)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M526](/packages/shopware-core)[flarum/core

Delightfully simple forum software.

201.4M2.2k](/packages/flarum-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
