-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
121 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -154,7 +154,6 @@ cython_debug/ | |
node_modules | ||
|
||
|
||
static/admin | ||
static/colorfield | ||
static/* | ||
media/* | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
from django.db import migrations | ||
from core.models import MailTemplate | ||
|
||
def add_initial_templates(apps, schema_editor): | ||
MailTemplate.objects.create( | ||
event='ticket_status_change', | ||
name='Ticket Status Change', | ||
language='en', | ||
subject='Your ticket status has changed', | ||
content='''\ | ||
Hello {ticket_creator_username}, | ||
This is to inform you that the status of your ticket #{ticket_id} {ticket_title} has been changed from "{ticket_status_old} to "{ticket_status}". | ||
Thank you for your patience. | ||
Best regards, | ||
[Your Organization Name] | ||
''' | ||
) | ||
|
||
MailTemplate.objects.create( | ||
event='new_ticket', | ||
name='New Ticket', | ||
language='en', | ||
subject='Your ticket has been created successfully', | ||
content='''\ | ||
Dear {ticket_creator_username}, | ||
We're writing to inform you that your ticket #{ticket_id} has been created successfully. | ||
Details: | ||
Title: {ticket_title} | ||
Category: {ticket_category} | ||
Description: | ||
{ticket_description} | ||
Our team will review your ticket and respond as soon as possible. You can track the status of your ticket by logging into your account. | ||
Thank you for reaching out to us. | ||
Best regards, | ||
[Your Organization Name] | ||
''' | ||
) | ||
|
||
MailTemplate.objects.create( | ||
event='ticket_assigned', | ||
name='Ticket Assignment', | ||
language='en', | ||
subject='A new ticket has been assigned to your team', | ||
content='''\ | ||
Hello Team, | ||
A new ticket has been created with the following details: | ||
Ticket ID: #{ticket_id} | ||
Title: {ticket_title} | ||
Priority: {ticket_priority} | ||
Category: {ticket_category} | ||
Created By: {ticket_creator_username} | ||
Description: | ||
{ticket_description} | ||
Please review the ticket and take appropriate action. | ||
Thank you for your attention. | ||
Best regards, | ||
[Your Organization Name] | ||
''' | ||
) | ||
|
||
MailTemplate.objects.create( | ||
event='new_comment', | ||
name='Comment Created', | ||
language='en', | ||
subject='New Comment on your Ticket: #{ticket_id} - {ticket_title}', | ||
content='''\ | ||
Hello {ticket_creator_username}, | ||
A new comment has been added to your ticket #{ticket_id} - "{ticket_title}". | ||
Comment: | ||
{comment_text} | ||
You can view the full conversation and reply to the comment by logging into your account. | ||
Thank you for using our ticket system. | ||
Best regards, | ||
[Your Organization Name] | ||
''' | ||
) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("ticketing", "0011_alter_fileattachment_file"), | ||
] | ||
|
||
operations = [migrations.RunPython(add_initial_templates),] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters