From 224ad8722fc98186c1de04f2d0ba27444d676961 Mon Sep 17 00:00:00 2001 From: Ross Poulton Date: Tue, 22 Jan 2008 06:10:48 +0000 Subject: [PATCH] * Add templates for escalation * E-mail owner, Queue CC and submitter on escalation --- scripts/escalate_tickets.py | 14 ++++++++++++++ templates/helpdesk/emails/cc_escalated.html | 10 ++++++++++ templates/helpdesk/emails/cc_escalated.txt | 7 +++++++ templates/helpdesk/emails/owner_escalated.html | 14 ++++++++++++++ templates/helpdesk/emails/owner_escalated.txt | 9 +++++++++ templates/helpdesk/emails/submitter_escalated.html | 14 ++++++++++++++ templates/helpdesk/emails/submitter_escalated.txt | 9 +++++++++ 7 files changed, 77 insertions(+) create mode 100644 templates/helpdesk/emails/cc_escalated.html create mode 100644 templates/helpdesk/emails/cc_escalated.txt create mode 100644 templates/helpdesk/emails/owner_escalated.html create mode 100644 templates/helpdesk/emails/owner_escalated.txt create mode 100644 templates/helpdesk/emails/submitter_escalated.html create mode 100644 templates/helpdesk/emails/submitter_escalated.txt diff --git a/scripts/escalate_tickets.py b/scripts/escalate_tickets.py index 318c187c..fe7158a9 100644 --- a/scripts/escalate_tickets.py +++ b/scripts/escalate_tickets.py @@ -60,6 +60,20 @@ def escalate_tickets(queues, verbose): t.last_escalation = datetime.now() t.priority -= 1 t.save() + + context = { + 'ticket': t, + 'queue': queue, + } + + if t.submitter_email: + send_multipart_mail('helpdesk/emails/submitter_escalated', context, '%s %s' % (t.ticket, t.title), t.submitter_email, t.queue.from_address) + + if t.queue.updated_ticket_cc: + send_multipart_mail('helpdesk/emails/cc_escalated', context, '%s %s' % (t.ticket, t.title), t.queue.updated_ticket_cc, t.queue.from_address) + + if t.assigned_to: + send_multipart_mail('helpdesk/emails/owner_escalated', context, '%s %s' % (t.ticket, t.title), t.assigned_to, t.queue.from_address) if verbose: print " - Esclating %s from %s>%s" % (t.ticket, t.priority+1, t.priority) diff --git a/templates/helpdesk/emails/cc_escalated.html b/templates/helpdesk/emails/cc_escalated.html new file mode 100644 index 00000000..53681949 --- /dev/null +++ b/templates/helpdesk/emails/cc_escalated.html @@ -0,0 +1,10 @@ +{% extends "helpdesk/emails/base.html" %} + +{% block header %}Ticket Escalated{% endblock %} + +{% block content %} +

Hello,

+ +

This is a courtesy e-mail to let you know that ticket {{ ticket.ticket }} ({{ ticket.title }}) has been escalated automatically.

+ +{% endblock %} diff --git a/templates/helpdesk/emails/cc_escalated.txt b/templates/helpdesk/emails/cc_escalated.txt new file mode 100644 index 00000000..e8a374c4 --- /dev/null +++ b/templates/helpdesk/emails/cc_escalated.txt @@ -0,0 +1,7 @@ +Hello, + +This is a courtesy e-mail to let you know that ticket {{ ticket.ticket }} ("{{ ticket.title }}") has been escalated automatically. + +You can view this online at {{ ticket.staff_url }}. + +{% include "helpdesk/emails/text_footer.txt" %} diff --git a/templates/helpdesk/emails/owner_escalated.html b/templates/helpdesk/emails/owner_escalated.html new file mode 100644 index 00000000..ce79ea9e --- /dev/null +++ b/templates/helpdesk/emails/owner_escalated.html @@ -0,0 +1,14 @@ +{% extends "helpdesk/emails/base.html" %} + +{% block header %}Ticket Escalated{% endblock %} + +{% block content %} +

Hello,

+ +

A ticket currently assigned to you with a subject of {{ ticket.title }} has been automatically escalated.

+ +

Please review this ticket and attempt to provide a resolution as soon as possible.

+ +

If you wish to view this ticket online, you can visit {{ ticket.get_staff_url }}.

+ +{% endblock %} diff --git a/templates/helpdesk/emails/owner_escalated.txt b/templates/helpdesk/emails/owner_escalated.txt new file mode 100644 index 00000000..6190adb3 --- /dev/null +++ b/templates/helpdesk/emails/owner_escalated.txt @@ -0,0 +1,9 @@ +Hello, + +A ticket currently assigned to you with a subject of "{{ ticket.title }}" has been automatically escalated. + +Please review this ticket and attempt to provide a resolution as soon as possible. + +If you wish to view this ticket online, you can visit {{ ticket.get_staff_url }}. + +{% include "helpdesk/emails/text_footer.txt" %} diff --git a/templates/helpdesk/emails/submitter_escalated.html b/templates/helpdesk/emails/submitter_escalated.html new file mode 100644 index 00000000..7762a1e0 --- /dev/null +++ b/templates/helpdesk/emails/submitter_escalated.html @@ -0,0 +1,14 @@ +{% extends "helpdesk/emails/base.html" %} + +{% block header %}Your Ticket Has Been Escalated{% endblock %} + +{% block content %} +

Hello,

+ +

You recently logged a ticket with a subject of {{ ticket.title }} with us. This e-mail is to advise you of an automated escalation of that ticket.

+ +

We will review your ticket shortly and attempt to provide a resolution as soon as possible.

+ +

If you wish to view this ticket online, you can visit {{ ticket.get_ticket_url }}.

+ +{% endblock %} diff --git a/templates/helpdesk/emails/submitter_escalated.txt b/templates/helpdesk/emails/submitter_escalated.txt new file mode 100644 index 00000000..b408678f --- /dev/null +++ b/templates/helpdesk/emails/submitter_escalated.txt @@ -0,0 +1,9 @@ +Hello,

+ +You recently logged a ticket with a subject of "{{ ticket.title }}" with us. This e-mail is to advise you of an automated escalation of that ticket. + +We will review your ticket shortly and attempt to provide a resolution as soon as possible. + +If you wish to view this ticket online, you can visit {{ ticket.get_ticket_url }}. + +{% include "helpdesk/emails/text_footer.txt" %}