···11+from django.db import migrations
22+from core.models import MailTemplate
33+44+def add_initial_templates(apps, schema_editor):
55+ MailTemplate.objects.create(
66+ event='ticket_status_change',
77+ name='Ticket Status Change',
88+ language='en',
99+ subject='Your ticket status has changed',
1010+ content='''\
1111+Hello {ticket_creator_username},
1212+1313+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}".
1414+1515+Thank you for your patience.
1616+1717+Best regards,
1818+[Your Organization Name]
1919+'''
2020+ )
2121+2222+ MailTemplate.objects.create(
2323+ event='new_ticket',
2424+ name='New Ticket',
2525+ language='en',
2626+ subject='Your ticket has been created successfully',
2727+ content='''\
2828+Dear {ticket_creator_username},
2929+3030+We're writing to inform you that your ticket #{ticket_id} has been created successfully.
3131+3232+Details:
3333+Title: {ticket_title}
3434+Category: {ticket_category}
3535+Description:
3636+{ticket_description}
3737+3838+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.
3939+4040+Thank you for reaching out to us.
4141+4242+Best regards,
4343+[Your Organization Name]
4444+'''
4545+ )
4646+4747+ MailTemplate.objects.create(
4848+ event='ticket_assigned',
4949+ name='Ticket Assignment',
5050+ language='en',
5151+ subject='A new ticket has been assigned to your team',
5252+ content='''\
5353+Hello Team,
5454+5555+A new ticket has been created with the following details:
5656+5757+Ticket ID: #{ticket_id}
5858+Title: {ticket_title}
5959+Priority: {ticket_priority}
6060+Category: {ticket_category}
6161+Created By: {ticket_creator_username}
6262+Description:
6363+{ticket_description}
6464+6565+Please review the ticket and take appropriate action.
6666+6767+Thank you for your attention.
6868+6969+Best regards,
7070+[Your Organization Name]
7171+'''
7272+ )
7373+7474+7575+7676+class Migration(migrations.Migration):
7777+7878+ dependencies = [
7979+ ("core", "0006_mailtemplate"),
8080+ ]
8181+8282+ operations = [migrations.RunPython(add_initial_templates),]