# Generated by Django 5.1 on 2024-08-31 10:28

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='EmailTemplate',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
                ('template_html', models.TextField(help_text='Variables format {{var}}  ,for preview copy html content and paste it on https://www.programiz.com/html/online-compiler/')),
            ],
        ),
        migrations.CreateModel(
            name='MailingService',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(choices=[('smtp', 'smtp'), ('sendgrid', 'sendgrid')], max_length=50, unique=True)),
                ('email_backend', models.CharField(blank=True, max_length=255, null=True)),
                ('api_key', models.CharField(blank=True, max_length=255, null=True)),
                ('email_host', models.CharField(blank=True, max_length=255, null=True)),
                ('email_port', models.IntegerField(blank=True, null=True)),
                ('email_use_tls', models.BooleanField(blank=True, default=True, null=True)),
                ('email_host_user', models.EmailField(blank=True, max_length=254, null=True)),
                ('email_host_password', models.CharField(blank=True, max_length=255, null=True)),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('updated_date', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='MailRecord',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('subject', models.CharField(max_length=255)),
                ('sender_mail', models.CharField(max_length=100)),
                ('to_mail', models.JSONField(max_length=100)),
                ('cc_mail', models.JSONField(blank=True, max_length=100, null=True)),
                ('bcc_mail', models.JSONField(blank=True, max_length=100, null=True)),
                ('payload_json', models.JSONField(blank=True, null=True)),
                ('body', models.TextField()),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('updated_date', models.DateTimeField(auto_now=True)),
                ('is_success', models.BooleanField(default=False)),
                ('mail_response', models.TextField(blank=True, null=True)),
                ('service', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='mail_configuration.mailingservice')),
            ],
        ),
    ]
