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 (
DripDropFieldMappingPanels,
DripDropFormFieldMixin,
DripDropFormMixin,
FlowChooserPanel,
)
class FormField(DripDropFormFieldMixin, AbstractFormField):
page = ParentalKey("ContactPage", related_name="form_fields", on_delete=models.CASCADE)
panels = AbstractFormField.panels + DripDropFieldMappingPanels()
class ContactPage(DripDropFormMixin, AbstractForm):
content_panels = AbstractForm.content_panels + [FlowChooserPanel()]
Field mapping
Each form field can be mapped to a DripDrop contact property via the DripDrop mapping dropdown in the Wagtail admin. The available contact mappings (First Name, Last Name, Email, Phone) are derived from the DripDrop SDK.
Selecting Custom Field maps the form field to a DripDrop custom field. A second dropdown appears to select the custom field key. Custom field keys are validated against the DripDrop API on save — if a key does not exist, a validation error is raised.
When a flow is selected, the form requires:
- At least one field mapped to First Name
- At least one field mapped to Email or Phone
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 and custom field choices are cached using Django's cache framework. The cache refreshes automatically on a 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 |
DRIPDROP_CUSTOM_FIELD_CACHE_TIMEOUT |
No | 3600 |
Custom field 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wagtail_dripdrop-0.2.0.tar.gz.
File metadata
- Download URL: wagtail_dripdrop-0.2.0.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a95d4d133455fc6816241993c61eb8b907894311a684f0e243ebf8a19f453080
|
|
| MD5 |
405cbfafe21f7766ce9ae97b598890d9
|
|
| BLAKE2b-256 |
18ade531ac7c9c98b5797475379c3feb7f4d87de3425a1e3b6386e42c7eb854d
|
Provenance
The following attestation bundles were made for wagtail_dripdrop-0.2.0.tar.gz:
Publisher:
publish.yml on layline-dev/wagtail-dripdrop
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wagtail_dripdrop-0.2.0.tar.gz -
Subject digest:
a95d4d133455fc6816241993c61eb8b907894311a684f0e243ebf8a19f453080 - Sigstore transparency entry: 1153974494
- Sigstore integration time:
-
Permalink:
layline-dev/wagtail-dripdrop@832234b2307c8beaf08789b59fff09b1d147be80 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/layline-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@832234b2307c8beaf08789b59fff09b1d147be80 -
Trigger Event:
release
-
Statement type:
File details
Details for the file wagtail_dripdrop-0.2.0-py3-none-any.whl.
File metadata
- Download URL: wagtail_dripdrop-0.2.0-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db51eaeccd0dc18e7d25887d398be9076370085743d8bcb7f0b69f4c0523f641
|
|
| MD5 |
4de647c0c71ff45f43d9a23b0870ce73
|
|
| BLAKE2b-256 |
ec2250818dd80da095a78848e1bd44864e2be4aae63388c97db619d3a66dd049
|
Provenance
The following attestation bundles were made for wagtail_dripdrop-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on layline-dev/wagtail-dripdrop
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wagtail_dripdrop-0.2.0-py3-none-any.whl -
Subject digest:
db51eaeccd0dc18e7d25887d398be9076370085743d8bcb7f0b69f4c0523f641 - Sigstore transparency entry: 1153974496
- Sigstore integration time:
-
Permalink:
layline-dev/wagtail-dripdrop@832234b2307c8beaf08789b59fff09b1d147be80 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/layline-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@832234b2307c8beaf08789b59fff09b1d147be80 -
Trigger Event:
release
-
Statement type: