···3344def 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',
66+ event='new_user',
77+ name='New User Account',
508 language='en',
5151- subject='A new ticket has been assigned to your team',
99+ subject='Welcome to [Your Organization Name]!',
5210 content='''\
5353-Hello Team,
1111+Hello {username},
54125555-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}
1313+Welcome to [Your Organization Name]!
64146565-Please review the ticket and take appropriate action.
1515+Your account has been successfully created. Here are your account details:
66166767-Thank you for your attention.
1717+Username: {username}
1818+Email Address: {email}
68196920Best regards,
7021[Your Organization Name]
7122'''
7223 )
73247474-75257626class Migration(migrations.Migration):
7727
+103
ticketing/migrations/0012_seed_mailtemplates.py
···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+ MailTemplate.objects.create(
7575+ event='new_comment',
7676+ name='Comment Created',
7777+ language='en',
7878+ subject='New Comment on your Ticket: #{ticket_id} - {ticket_title}',
7979+ content='''\
8080+Hello {ticket_creator_username},
8181+8282+A new comment has been added to your ticket #{ticket_id} - "{ticket_title}".
8383+8484+Comment:
8585+{comment_text}
8686+8787+You can view the full conversation and reply to the comment by logging into your account.
8888+8989+Thank you for using our ticket system.
9090+9191+Best regards,
9292+[Your Organization Name]
9393+'''
9494+ )
9595+9696+9797+class Migration(migrations.Migration):
9898+9999+ dependencies = [
100100+ ("ticketing", "0011_alter_fileattachment_file"),
101101+ ]
102102+103103+ operations = [migrations.RunPython(add_initial_templates),]