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
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.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf4afd341c3e1e2899c8a77494d066f5c7a5707a6b3e81d88890236a9c2a4f3e
|
|
| MD5 |
02cf410d7a174d3a01e1a3ca4cc7592f
|
|
| BLAKE2b-256 |
f6c4275b4447c9bd9dce7d6c85e0f8b01ddb7d907978491aea47a103d60044b5
|
Provenance
The following attestation bundles were made for wagtail_dripdrop-0.1.3.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.1.3.tar.gz -
Subject digest:
cf4afd341c3e1e2899c8a77494d066f5c7a5707a6b3e81d88890236a9c2a4f3e - Sigstore transparency entry: 1144099894
- Sigstore integration time:
-
Permalink:
layline-dev/wagtail-dripdrop@c1bc40e7772b139eb5f53c4d99693eb65e94e1f5 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/layline-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c1bc40e7772b139eb5f53c4d99693eb65e94e1f5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file wagtail_dripdrop-0.1.3-py3-none-any.whl.
File metadata
- Download URL: wagtail_dripdrop-0.1.3-py3-none-any.whl
- Upload date:
- Size: 11.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 |
2645cf11fb81f32dc31303b8b6d869583bf361544bedcaefcf141cc9b27e3e02
|
|
| MD5 |
7d2a7830b1da30e6c9ad0e0b2339ca37
|
|
| BLAKE2b-256 |
fca13d42462d1b2d738d5e2ca28994b2810bb2ba2948f76efe0cf264f92d1c66
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wagtail_dripdrop-0.1.3-py3-none-any.whl -
Subject digest:
2645cf11fb81f32dc31303b8b6d869583bf361544bedcaefcf141cc9b27e3e02 - Sigstore transparency entry: 1144099982
- Sigstore integration time:
-
Permalink:
layline-dev/wagtail-dripdrop@c1bc40e7772b139eb5f53c4d99693eb65e94e1f5 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/layline-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c1bc40e7772b139eb5f53c4d99693eb65e94e1f5 -
Trigger Event:
release
-
Statement type: