Metadata-Version: 2.4
Name: pretalx-webhooks
Version: 2026.2.1
Summary: Call a webhook for selected pretalx event activity.
Author-email: Florian Mösch <florian@moesch.org>
Maintainer-email: Florian Mösch <florian@moesch.org>
License-Expression: Apache-2.0
Project-URL: homepage, https://github.com/badbadc0ffee/pretalx-webhooks
Project-URL: repository, https://github.com/badbadc0ffee/pretalx-webhooks.git
Project-URL: issues, https://github.com/badbadc0ffee/pretalx-webhooks/issues
Keywords: pretalx
Requires-Python: >=3.13
Description-Content-Type: text/x-rst
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pretalx[dev]; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: check-manifest; extra == "dev"
Requires-Dist: djangofmt; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: pytest-django; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Dynamic: license-file

pretalx-webhooks
================

.. image:: https://img.shields.io/pypi/v/pretalx-webhooks.svg
   :target: https://pypi.org/project/pretalx-webhooks/
   :alt: PyPI version

.. image:: https://github.com/badbadc0ffee/pretalx-webhooks/actions/workflows/tests.yml/badge.svg
   :target: https://github.com/badbadc0ffee/pretalx-webhooks/actions/workflows/tests.yml
   :alt: Tests

``pretalx-webhooks`` sends HTTP requests for selected pretalx activity log
entries. Each event can use multiple webhooks.

Installation
------------

Install the plugin in the same Python environment as pretalx::

    python -m pip install pretalx-webhooks
    python -m pretalx migrate

Restart pretalx. In the organiser area, open **Settings → Plugins** and enable
the plugin for the event.

Configuration
-------------

Open **Settings → Webhook** in the event settings. The page lists all webhooks
for the event.

Select **Add webhook** to create a webhook. Then configure these fields:

* **Action**: The activity log entry that sends the webhook.
* **URL**: An HTTP or HTTPS target. An empty URL disables the webhook.
* **Method**: ``GET``, ``POST``, or ``PUT``.
* **Payload**: The request body for ``POST`` and ``PUT``.
* **HTTP Header**: Optional request header names and values.

Select a webhook in the list to edit or delete it.

Payload
-------

``GET`` does not send a request body. ``POST`` and ``PUT`` send the payload as
UTF-8 text. A valid JSON payload uses ``application/json``. Other payloads use
``text/plain`` unless a custom ``Content-Type`` header is present.

The payload supports pretalx event mail placeholders. For example::

    {"event": "{event_slug}"}

JSON object braces do not need escaping. The configuration page shows an error
for an unknown placeholder.

pretalx writes failed requests and non-success HTTP responses to its log.

Development
-----------

Install `uv`_ and `just`_. Then run the checks::

    just fmt-check
    just test

Use ``just install-pretalx-local /path/to/pretalx`` to test with a local pretalx
checkout.

License
-------

Copyright 2026 Florian Mösch

Released under the terms of the Apache License 2.0

.. _just: https://just.systems/
.. _uv: https://docs.astral.sh/uv/
