PHPackages                             dmstr/yii2-contact-module - 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. dmstr/yii2-contact-module

ActiveYii2-extension

dmstr/yii2-contact-module
=========================

Contact form manager for Yii 2.0 Framework

3.3.2(1y ago)553.2k—4.2%1[1 issues](https://github.com/dmstr/yii2-contact-module/issues)BSD-4-ClausePHPCI failing

Since Apr 9Pushed 1y ago4 watchersCompare

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

READMEChangelog (10)Dependencies (5)Versions (50)Used By (0)

Configuring template
--------------------

[](#configuring-template)

Navigate to `/contact/crud/contact-template` to create a new form template.

propertyrequireddescriptionNameyesa unique name, e.g. 'reservation'From Emailyesvalid email used as 'From:' headerTo Emailyesone or more valid email addresses (comma separated) used as 'To:' headerReply To Emailnooptional, valid email. Use this if you want to set 'Reply-To:' header to a fixed address for ALL mails. If set 'Reply to Schema Property' will be irgnored!Reply to Schema Propertynocan be used to define which property from schema should be used (if valid mail!) as 'Reply-To:' header. If 'Reply To Email' is set to a fixed address, this will be ignoredReturn Pathnoif set and is a valid email, this will be used as 'Return-Path:' header where bounce Mails will be send to. Handle with careCaptchanothis tells the contact module that a captcha will be used and that it has to validated against it (sets model scenario to captcha). Captcha widget is required in twig!Form Schemayesjson-schema used to build a form with `dmstr/jsoneditor/JsonEditorWidget` (For more information about schema see examples on: )Upgrade hints:
--------------

[](#upgrade-hints)

- If the form was build with version &lt;= 1.0.0 there was the convention, that property reply\_to in your schema was used as 'Reply-To:' header in message.
- this "magick" is removed! You must now set 'Reply to Schema Property' to 'reply\_to' to get the same behavior!

Twig templates (Views)
----------------------

[](#twig-templates-views)

Each form needs 2 Twig templates. Navigate to `/prototype/twig/index` to create them:

- `contact:FORM_NAME`: template in which the form will be rendered
- `contact:FORM_NAME:send`: will be rendered as "thank you page" after message has been send

While `FORM_NAME` must be replaced with your template name

- The form can be seen at `/contact/default/?schema=FORM_NAME`
- The "thank you page" can be seen at `/contact/default/done?schema=FORM_NAME`

### Form Twig layout

[](#form-twig-layout)

```
{{ use('dmstr/jsoneditor/JsonEditorWidget') }}
{{ use('yii/widgets/ActiveForm') }}

            {% set form = active_form_begin({
                'id': 'contact-form',
                'action' : '',
                'options': {
                }
            }) %}

            {{ form.errorSummary(model) | raw }}

            {{ json_editor_widget_widget({
                'model': model,
                'attribute': 'json',
                'options': {
                    'id': 'contact-json'
                },
                'clientOptions': {
                    'theme': 'bootstrap3',
                    'disable_collapse': true,
                    'disable_edit_json': true,
                    'disable_properties': true,
                    'no_additional_properties': true,
                    'show_errors': 'interaction'
                },
                'schema': schema,
            }) }}

            {{ t('twig-widget', 'Send') }}

            {{ active_form_end() }}

```

### Form Twig layout with captcha (requires `captcha` activate in the contact-template)

[](#form-twig-layout-with-captcha-requires-captcha-activate-in-the-contact-template)

```
{{ use('dmstr/jsoneditor/JsonEditorWidget') }}
{{ use('yii/widgets/ActiveForm') }}
{{ use('yii/captcha/Captcha') }}

            {% set form = active_form_begin({
                'id': 'contact-form',
                'action' : '',
                'options': {
                }
            }) %}

            {{ form.errorSummary(model) | raw }}

            {{ json_editor_widget_widget({
                'model': model,
                'attribute': 'json',
                'options': {
                    'id': 'contact-json'
                },
                'clientOptions': {
                    'theme': 'bootstrap3',
                    'disable_collapse': true,
                    'disable_edit_json': true,
                    'disable_properties': true,
                    'no_additional_properties': true,
                    'show_errors': 'interaction'
                },
                'schema': schema,
            }) }}

            {{ Captcha_widget({
                model: model,
                attribute: 'captcha',
                captchaAction: '/contact/default/captcha'
            }) }}

            {{ t('twig-widget', 'Send') }}

            {{ active_form_end() }}

```

- The background and foreground colors of the captcha can be defined in the settings module under the `captcha` section. It uses a particular format for colors but the last 6 characters follow the css hex color code(eg 0xff0000 is red and 0x00ff00 is green)

### "Thank you page" Twig layout

[](#thank-you-page-twig-layout)

```
{{ t('twig-widget', 'Thank you for your message') }}
```

### Contact form widgets twig example

[](#contact-form-widgets-twig-example)

```
{{ use('dmstr/modules/contact/widgets/ContactForm') }}

{{ contact_form_widget({schemaName: schemaName}) }}
```

### Settings schema

[](#settings-schema)

```
{
  "title": " ",
  "type": "object",
  "format": "grid",
  "properties": {
    "Company": {
      "type": "string",
      "minLength": 3,
      "title": "Firma",
      "propertyOrder": 5,
      "options": {
        "grid_columns": 12
      }
    },
    "Title": {
      "type": "string",
      "title": "Anrede",
      "minLength": 1,
      "propertyOrder": 10,
      "enum": [
        "Herr",
        "Frau"
      ],
      "options": {
        "enum_titles": [
          "Herr",
          "Frau"
        ],
        "grid_columns": 2
      }
    },
    "LastName": {
      "type": "string",
      "minLength": 3,
      "title": "Name",
      "propertyOrder": 20,
      "options": {
        "grid_columns": 5
      }
    },
    "SurName": {
      "type": "string",
      "minLength": 3,
      "title": "Vorname",
      "propertyOrder": 30,
      "options": {
        "grid_columns": 5
      }
    },
    "Zip": {
      "type": "string",
      "minLength": 5,
      "title": "PLZ",
      "propertyOrder": 40,
      "options": {
        "grid_columns": 2
      }
    },
    "Location": {
      "type": "string",
      "minLength": 3,
      "title": "Ort",
      "propertyOrder": 50,
      "options": {
        "grid_columns": 5
      }
    },
    "Street": {
      "type": "string",
      "title": "Straße/Hausnr.",
      "minLength": 5,
      "propertyOrder": 60,
      "options": {
        "grid_columns": 5
      }
    },
    "Phone": {
      "type": "string",
      "title": "Telefon",
      "minLength": 6,
      "propertyOrder": 60,
      "options": {
        "grid_columns": 5
      }
    },
    "Fax": {
      "type": "string",
      "title": "Fax",
      "propertyOrder": 60,
      "options": {
        "grid_columns": 5
      }
    },
    "Email": {
      "type": "string",
      "format": "email",
      "minLength": 1,
      "title": "E-Mail Adresse",
      "propertyOrder": 70,
      "options": {
        "grid_columns": 6
      }
    },
    "Internet": {
      "type": "string",
      "title": "Internet",
      "propertyOrder": 70,
      "options": {
        "grid_columns": 6
      }
    },
    "Message": {
      "type": "string",
      "format": "textarea",
      "title": "Nachricht (stichwortartig)",
      "propertyOrder": 90,
      "options": {
        "grid_columns": 12
      }
    }
  }
}
```

Export
------

[](#export)

To enable the export feature add *kartik\\grid\\Module* to your project modules

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance40

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~80 days

Recently: every ~73 days

Total

37

Last Release

435d ago

Major Versions

0.4.1 → 1.0.02020-01-23

1.3.0-beta1 → 2.0.0-beta12021-04-19

2.0.0 → 3.0.02021-12-15

2.1.0 → 3.1.02023-06-05

2.2.0 → 3.2.02024-05-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b4ab2b6685ec71887908ec8cff261a16cd5bb24c69bb8ab52840e220f175f9d?d=identicon)[schmunk](/maintainers/schmunk)

---

Top Contributors

[![eluhr](https://avatars.githubusercontent.com/u/13000805?v=4)](https://github.com/eluhr "eluhr (29 commits)")[![schmunk42](https://avatars.githubusercontent.com/u/649031?v=4)](https://github.com/schmunk42 "schmunk42 (21 commits)")[![handcode](https://avatars.githubusercontent.com/u/825574?v=4)](https://github.com/handcode "handcode (15 commits)")[![gbisurgi](https://avatars.githubusercontent.com/u/18024942?v=4)](https://github.com/gbisurgi "gbisurgi (7 commits)")[![marc7000](https://avatars.githubusercontent.com/u/1118837?v=4)](https://github.com/marc7000 "marc7000 (5 commits)")[![germanbisurgi](https://avatars.githubusercontent.com/u/13135260?v=4)](https://github.com/germanbisurgi "germanbisurgi (4 commits)")

---

Tags

yii2extension

### Embed Badge

![Health badge](/badges/dmstr-yii2-contact-module/health.svg)

```
[![Health](https://phpackages.com/badges/dmstr-yii2-contact-module/health.svg)](https://phpackages.com/packages/dmstr-yii2-contact-module)
```

###  Alternatives

[dmstr/yii2-pages-module

Application sitemap and navigation manager module for Yii 2.0 Framework

3177.5k2](/packages/dmstr-yii2-pages-module)[skeeks/cms

SkeekS CMS — control panel and tools based on php framework Yii2

13825.6k47](/packages/skeeks-cms)[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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