Home

Awesome

cmsplugin-contact-plus

Build Status Coverage Status

cmsplugin-contact-plus lets you build forms for your Django CMS project with exactly the fields you want in the order you want with a minimal effort.

Beside the regular input fields there are "auto" fields, for example to submit the referral page, or additional, hidden values. The form will be submitted to an email address that is defined per form. This allows to cover a lot of use cases with a single and simple plugin.

cmsplugin-contact-plus is licensed under the MIT License.

Dependencies

This plugin has been tested with:

Quickstart

  1. To install from PyPI, in your virtualenv run

    pip install cmsplugin_contact_plus
    

    or to get the latest commit from GitHub,

    pip install -e git+git://github.com/arteria/cmsplugin-contact-plus.git#egg=cmsplugin_contact_plus
    
  2. cmsplugin-contact-plus requires https://github.com/iambrandontaylor/django-admin-sortable as dependency. Please have a look at the "Supported Django Versions", "Installation", and "Configuration" sections of the README.

  3. Put cmsplugin_contact_plus and adminsortable in your INSTALLED_APPS settings.py section and verify that the ADMINS setting is set as well.

  4. Don't forget to migrate your database.

  5. Configure Django's e-mail settings appropriately.

Configuration/Settings

CONTACT_PLUS_FROM_EMAIL

Specify DEFAULT_FROM_EMAIL (https://docs.djangoproject.com/en/dev/ref/settings/#default-from-email) in your projects settings to send emails from a specific address. Otherwise Django's default 'webmaster@localhost' will be used.

CONTACT_PLUS_REPLY_EMAIL_LABEL

To set the reply-to header for the email automatically, specify CONTACT_PLUS_REPLY_EMAIL_LABEL in your project settings. If the label is "your email" for example, then set CONTACT_PLUS_REPLY_EMAIL_LABEL='your-email' - basically it's the slugified field label that is used to look up the reply-to email address.

CONTACT_PLUS_SEND_COPY_TO_REPLY_EMAIL

To send a carbon copy to the submitter you can set the CONTACT_PLUS_SEND_COPY_TO_REPLY_EMAIL to True. If a Field with the label email exists this email will be used as Cc Header.

CONTACT_PLUS_REQUIRED_CSS_CLASS

Defines the required CSS class, default is required.

CMSPLUGIN_CONTACT_PLUS_TEMPLATES

To allow users to choose between multiple contact form templates, specify the template choices in your project settings like this:

CMSPLUGIN_CONTACT_PLUS_TEMPLATES = [
    ('cmsplugin_contact_plus/contact.html', 'Contact Form'),
    ('cmsplugin_contact_plus/contact_newsletter.html', 'Newsletter Form'),
]

Make sure that the templates can be loaded by Django.

CMSPLUGIN_CONTACT_FORM_VALIDATORS

Specify CMSPLUGIN_CONTACT_FORM_VALIDATORS in your projects settings to one or more validator functions that are used with the CharFieldWithValidator field. Expected is a list of strings, each string should point a validator function by its full path. For example:

CMSPLUGIN_CONTACT_FORM_VALIDATORS = [
  'myproject.utils.validators.phone_number_validator',
]

CONTACT_PLUS_SEND_HTML_EMAIL

Default is False. If activated, the notification email is sent as multipart/alternative.

CONTACT_PLUS_FAIL_SILENTLY

Default is True. If deactivated, email failure is not silent anymore.

reCAPTCHA

To make the reCAPTCHA field type available to your users, add 'captcha' to your INSTALLED_APPS and define your RECAPTCHA_PUBLIC_KEY and RECAPTCHA_PRIVATE_KEY as described in django-recaptcha's README. A single reCAPTCHA instance per page is supported.

Templates

If you are not using the default template settings of Django, make sure that 'django.template.loaders.app_directories.Loader' is added to the TEMPLATES.OPTIONS.loaders list in your settings.py file. Likewise, if your Django version is < 1.8, make sure that the above-mentioned loader is in your list of TEMPLATE_LOADERS.

Features

Notes

TODO and planned features .

cmsplugin-contact-plus is free software. If you find it useful and would like to give back, please consider to make a donation using Bitcoin or PayPal. Thank you!

Changelog

Development

Please have a look at the latest commits for the work-in-progress development version.

1.3.23 - 22. 03. 2021

1.3.21 - 15. 02. 2021

1.3.20 - 10. 11. 2020

1.3.18 - 19. 06. 2020

1.3.13 - 28. 10. 2019

1.3.12 - 28. 08. 2017

1.3.11 - 27. 04. 2017

1.3.10 - 12. 04. 2017

1.3.9 - 10. 04. 2017

1.3.8 - 10. 04. 2017

1.3.7 - 22. 03. 2017

1.3.6 - 21. 03. 2017

1.3.5 - 22. 02. 2017

1.3.2 - 07. 12. 2016

1.3.1 - 07. 11. 2016

1.3.0 - 10. 10. 2016

1.2.7 - 29. 03. 2016

1.2.6 - 05. 01. 2015

1.2.5 - 10. 11. 2015

1.2.3

1.1.14 - 20. 03. 2015

1.1.13 - 17. 11. 2014

1.1.12

1.1.11

1.1.10

1.1.9

1.1.8

1.1.7

1.1.6

1.1.5

1.1.4

1.1.3

1.1.2

1.1.1

1.1.0

1.0.4

1.0.3

For example, the field lable for the 'CharField as HiddenInput' is named to "Object description". Using the lable name, the ID for the input field will be 'id_object-description', the name 'object-description'.

Store data is dead easy using jQuery.

$('#id_object-description').val('Hello Hidden World'); // The string 'Hello Hidden World' will be send by email as well.

1.0.2

Fixed indentation /EOF in setup.py

1.0.1

Fixed IndentationError in setup.py

1.0.0

arteria open sourced cmsplugin_contact_plus unter the MIT License. This plugin was built on a fork of cmsplugin_contact. Kudos!