Skip to main content

Connect Wagtail form pages to DripDrop flows.

Project description

wagtail-dripdrop

Connect Wagtail form pages to DripDrop flows. When a form is submitted, wagtail-dripdrop creates or enrolls a contact in the selected flow using the DripDrop public API.

Installation

pip install wagtail-dripdrop

Add to your Django settings:

INSTALLED_APPS = [
    # ...
    "wagtail_dripdrop",
    # ...
]

Configure your DripDrop API key:

DRIPDROP_API_KEY = "your-api-key"

Usage

Create a form page that enrolls submissions into a DripDrop flow:

from wagtail.contrib.forms.models import AbstractForm, AbstractFormField
from modelcluster.fields import ParentalKey

from wagtail_dripdrop import DripDropFormMixin, FlowChooserPanel


class FormField(AbstractFormField):
    page = ParentalKey("ContactPage", related_name="form_fields", on_delete=models.CASCADE)


class ContactPage(DripDropFormMixin, AbstractForm):
    content_panels = AbstractForm.content_panels + [FlowChooserPanel()]

When editing the page in Wagtail admin, select a DripDrop flow from the dropdown. The form requires a first_name field and at least one of email or phone to be present when a flow is selected.

On submission, the contact is created and enrolled in the selected flow. If the contact already exists (409 response), they are automatically enrolled via the enrollments endpoint.

Cache

Flow choices are cached using Django's cache framework. The cache refreshes automatically on miss, or you can manually refresh it from the Wagtail admin menu ("Refresh DripDrop Cache").

Settings

Setting Required Default Description
DRIPDROP_API_KEY Yes Your DripDrop API key
DRIPDROP_API_BASE_URL No https://api.dripdrop.dev Base URL for the DripDrop API
DRIPDROP_FLOW_CACHE_TIMEOUT No 3600 Flow list cache timeout in seconds

Development

git clone https://github.com/layline-dev/wagtail-dripdrop.git
cd wagtail-dripdrop
pip install -e .[dev]
ruff check .
pytest

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wagtail_dripdrop-0.1.3.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wagtail_dripdrop-0.1.3-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file wagtail_dripdrop-0.1.3.tar.gz.

File metadata

  • Download URL: wagtail_dripdrop-0.1.3.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for wagtail_dripdrop-0.1.3.tar.gz
Algorithm Hash digest
SHA256 cf4afd341c3e1e2899c8a77494d066f5c7a5707a6b3e81d88890236a9c2a4f3e
MD5 02cf410d7a174d3a01e1a3ca4cc7592f
BLAKE2b-256 f6c4275b4447c9bd9dce7d6c85e0f8b01ddb7d907978491aea47a103d60044b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for wagtail_dripdrop-0.1.3.tar.gz:

Publisher: publish.yml on layline-dev/wagtail-dripdrop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wagtail_dripdrop-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for wagtail_dripdrop-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2645cf11fb81f32dc31303b8b6d869583bf361544bedcaefcf141cc9b27e3e02
MD5 7d2a7830b1da30e6c9ad0e0b2339ca37
BLAKE2b-256 fca13d42462d1b2d738d5e2ca28994b2810bb2ba2948f76efe0cf264f92d1c66

See more details on using hashes here.

Provenance

The following attestation bundles were made for wagtail_dripdrop-0.1.3-py3-none-any.whl:

Publisher: publish.yml on layline-dev/wagtail-dripdrop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page