PHPackages                             rmzamora/contact-bundle - 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. rmzamora/contact-bundle

ActiveLibrary

rmzamora/contact-bundle
=======================

forked version of ihqs/contact-bundle - Contact form integration for symfony

051PHP

Since Oct 27Pushed 11y agoCompare

[ Source](https://github.com/rmzamora/ContactBundle)[ Packagist](https://packagist.org/packages/rmzamora/contact-bundle)[ RSS](/packages/rmzamora-contact-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Provides a simple but powerful contact form built onto the Observer Pattern. Plug any listener you want to your contact form's submission

Todo
====

[](#todo)

- Add mongodb configuration files
- Add unit tests
- Comment methods and attributes
- Cleanup

(Quite the same as for GithubBundle, we are sorry for that methodology but we'll correct that soon).

Features
========

[](#features)

- Compatible with Doctrine ORM **and** ODM thanks to a generic repository.
- Model is extensible at will
- Observer Pattern designed for more flexibility
- Every class is customizable

Installation
============

[](#installation)

**Using submodules**If you prefer instead to use git submodules, the run the following:

```
$ git submodule add git://github.com/rz/ContactBundle.git    src/Rz/ContactBundle

```

**Using the vendors script**

Add the following lines in your `deps` file:

```
[RzContactBundle]
    git=git://github.com/rz/ContactBundle.git
    target=bundles/Rz/ContactBundle

```

If you want to connect the email listener, install SwitfMailer and configure it

```
$ git submodule add git://github.com/swiftmailer.git    src/vendor/swiftmailer

```

or via `deps` file

```
[swiftmailer]
    git=http://github.com/swiftmailer/swiftmailer.git
    version=v4.1.2

```

In your config, add :

```
swiftmailer.config:
    transport:  smtp
    encryption: ssl
    auth_mode:  login
    host:       domain.tld
    username:   name@domain.tld
    password:   your_secret

```

Add the Rz namespace to your autoloader
---------------------------------------

[](#add-the-rz-namespace-to-your-autoloader)

```
// app/autoload.php
$loader->registerNamespaces(array(
    'Rz' => __DIR__.'/../vendor/bundles',
    // your other namespaces
);

```

Add ContactBundle to your application kernel
--------------------------------------------

[](#add-contactbundle-to-your-application-kernel)

```
// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Rz\ContactBundle\RzContactBundle(),
        // ...
    );
}

```

Update your schema
------------------

[](#update-your-schema)

```
app/console doctrine:schema:update --force

```

Adding the form to your templates
---------------------------------

[](#adding-the-form-to-your-templates)

In your template, you just have to add (if you are using Twig)

```
{% render "RzContactBundle:Contact:form" with { 'method': app.request.method }, { 'query': app.request.request.all } %}

```

Since version 2.0.13 of Symfony you must send your form "POST" data using "query" parameter. That's because "render" tag is being processed as a sub-request. And since that version all sub-requests are forced to use "GET" method therefore your embedded ContactController will loose all "POST" data if you miss it. As well you should explicitly specify the request method in "method" parameter to let the embedded ContactController recognize that your form is submitted.

Configuration
=============

[](#configuration)

In your app/config.yml (given you are using YAML for your configuration file)

```
rz_contact:
    contact:
        form:
            type:               rz_contact_contact
            handler:            rz_contact.contact.form.handler.default
            name:               rz_contact_contact_form
            validation_groups:  [Contact]
    form: ~                                 # (optional) class managing the contact form
    model: ~                                # (optional) class managing the model
    connectors:                             # the list of "listeners" (or connectors here)
        email:                              # connecting the email listener
            recipients: contact@rz.net    # giving him the recipient(s) email(s)
        database:                           # connecting the database listener
            db_driver: orm                  # giving him the database driver
        file: ~                             # connecting the file logger listener

```

If you want a simple contact form only sending an email to you contact mailbox, then you just have to add to your configuration file

```
rz_contact:
    connectors:
        email:
            recipients: cont@ct.me

```

It you want to use a custom template/view instead of the default one (RzContactBundle:Contact:form.html.twig), you can add the view parameter with the name of your view. Example:

```
rz_contact:
    contact:
        form:
			view:               CompanyExampleBundle:Contact:form.html.twig

```

Using Akismet for Spam Detection
================================

[](#using-akismet-for-spam-detection)

skip the step if you dont want to check for spam, by default no spam will be detected. Install the [OrnicarAkismentBundle](https://github.com/ornicar/OrnicarAkismetBundle) and configure it properly. see the docs for more information.

define the service in your service container

```
rz_contact:
    spam_detector:
        service: ornicar_akismet

```

now all your Contact Request will be checked by Akismet.

if you want to implement your own Detector simply set the class for the detector

```
rz_contact:
    spam_detector:
        class: My\Bundle\MyDetector

```

note that the class should implement the `SpamDetectorInterface`

or if you want a whole new service:

```
rz_contact:
    spam_detector:
        service: my_detector_service

```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 59% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2629aaa120706e711ccaed6a2dd7879cbed9ee74799eccb0db9bf28255ba7e90?d=identicon)[mellzamora](/maintainers/mellzamora)

---

Top Contributors

[![AlepH-FR](https://avatars.githubusercontent.com/u/281495?v=4)](https://github.com/AlepH-FR "AlepH-FR (23 commits)")[![mik356ua](https://avatars.githubusercontent.com/u/1441080?v=4)](https://github.com/mik356ua "mik356ua (5 commits)")[![rmzamora](https://avatars.githubusercontent.com/u/350139?v=4)](https://github.com/rmzamora "rmzamora (3 commits)")[![digitalkaoz](https://avatars.githubusercontent.com/u/293591?v=4)](https://github.com/digitalkaoz "digitalkaoz (3 commits)")[![Bieleke](https://avatars.githubusercontent.com/u/820570?v=4)](https://github.com/Bieleke "Bieleke (2 commits)")[![mente](https://avatars.githubusercontent.com/u/391997?v=4)](https://github.com/mente "mente (1 commits)")[![hostingnuggets](https://avatars.githubusercontent.com/u/776801?v=4)](https://github.com/hostingnuggets "hostingnuggets (1 commits)")[![pentarim](https://avatars.githubusercontent.com/u/210605?v=4)](https://github.com/pentarim "pentarim (1 commits)")

### Embed Badge

![Health badge](/badges/rmzamora-contact-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/rmzamora-contact-bundle/health.svg)](https://phpackages.com/packages/rmzamora-contact-bundle)
```

PHPackages © 2026

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