Skip to main content

Django views and forms that submit tickets to Zendesk

Project description

Settings

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

Usage

Add an entry to your urls.py

from zendesk_tickets import views
from zendesk_tickets import forms

url(r'^submit_ticket/$', views.ticket, {
        'template_name': 'xxx/submit_ticket_page.html',
        'success_redirect_url': '/',
        'ticket_template_name': 'zendesk_tickets/ticket.txt',
        'form_class': forms.TicketForm,
        'subject': 'Website Ticket',
        'tags': [],
        'extra_context': {},
    }, 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.

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.10.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

django_zendesk_tickets-0.10-py3-none-any.whl (7.3 kB view hashes)

Uploaded Python 3

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