Skip to main content

Django views and forms that submit tickets to Zendesk

Project description

An extensible library to add Django views with forms to submit tickets to Zendesk.

Usage

Add these to your settings.py:

ZENDESK_BASE_URL = 'https://example.zendesk.com'
ZENDESK_API_USERNAME = ...
ZENDESK_API_TOKEN = ...
ZENDESK_REQUESTER_ID = ...
ZENDESK_GROUP_ID = ...

Add an entry to your urls.py

from zendesk_tickets.views import TicketView

path(r'submit-ticket/$', TicketView.as_view(
    success_url='/',
    template_name='app_name/submit-ticket-page.html',
    ticket_subject='Website Feedback',
    ticket_tags=['website', 'feedback']
    ticket_template_name='app_name/feedback-ticket.txt',
), name='submit_ticket'),

If you wish to include additional fields, subclass BaseTicketForm and add them. If you wish to include them in the body of the ticket, create a new ticket template and pass it as the ticket_template_name. If you wish to include them as custom fields, define the following in your settings.py:

ZENDESK_CUSTOM_FIELDS = {
    'referer': 31,  # zendesk field id
    'username': 32,
    'user_agent': 33,
}

The three fields in the example above are included in TicketForm by default and can be included in your ticket by referencing them in the ticket template or specifying custom field ids in settings.

Development

https://github.com/ministryofjustice/django-zendesk-tickets/actions/workflows/test.yml/badge.svg?branch=main https://github.com/ministryofjustice/django-zendesk-tickets/actions/workflows/lint.yml/badge.svg?branch=main

Please report bugs and open pull requests on GitHub.

Use python setup.py test to run all tests.

If any localisable strings change, run python setup.py makemessages compilemessages.

Distribute a new version to PyPi by updating the VERSION tuple in zendesk_tickets/__init__.py and publishing a release in GitHub (this triggers a GitHub Actions workflow to automatically upload it). Alternatively, run python setup.py compilemessages sdist bdist_wheel upload locally. Remember to update History.

History

0.16

Drop support for python 3.6 and 3.7. Add support for python 3.11. Add experimental support for Django versions 4.0 & 4.1. Improve testing and linting.

0.15

Add support for python 3.9 and 3.10. Improve testing and linting.

0.14

Drop support for python 3.5. Improve linting.

0.13

Drop python 2 support (now compatible with 3.5 - 3.8). Support Django 2.2 - 3.2 (both LTS).

0.12

Improve testing and linting.

0.11

Support Django 1.10 - 2.0. Add class-based Django views. Add internationalisation support.

0.10

Fix display of tickets in Zendesk.

0.9

Don’t allow self-referential return-to URL.

0.8

Accept extra template context in views.

0.7

Use email address of logged-in user when available.

0.6

Collect email address of form submitter, optionally.

0.5

Fix bugs.

0.4

Provide a safe “return back to where you came from” link.

0.3

Add success view.

0.2

Fix bugs.

0.1

Original release.

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

django-zendesk-tickets-0.16.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

django_zendesk_tickets-0.16-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file django-zendesk-tickets-0.16.tar.gz.

File metadata

  • Download URL: django-zendesk-tickets-0.16.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for django-zendesk-tickets-0.16.tar.gz
Algorithm Hash digest
SHA256 65226e421f5acdb42302c0b755c11fe0f317bd1943e0d25fa9b919275273f9d0
MD5 3f0a15b94dd084cd3ea8afaa578501c1
BLAKE2b-256 6779f3ab4d81992811d550d837cb9d5597ba5df1ad7ae81ffd66a8bdfe92a02b

See more details on using hashes here.

Provenance

File details

Details for the file django_zendesk_tickets-0.16-py3-none-any.whl.

File metadata

File hashes

Hashes for django_zendesk_tickets-0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 558cf16d6031c241f66a1f38241734df5cfb66df4c27c0ba93d309091f656c86
MD5 de81d440e6a45a3a994cc3f6168bcd73
BLAKE2b-256 53971bb53393b516ae6ff93472bfcd3964f7ceaef269aef66bf33cc4c9be13f7

See more details on using hashes here.

Provenance

Supported by

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