# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
import emailmessagetemplates.fields
import django.core.mail.message


class Migration(migrations.Migration):

    dependencies = [
        ('contenttypes', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='EmailMessageTemplate',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(max_length=50)),
                ('object_id', models.PositiveIntegerField(null=True, verbose_name=b'Related Object ID', blank=True)),
                ('type', models.CharField(default=b'text/plain', help_text=b'Should email content generated by this template be sent as plain text or HTML?', max_length=20, choices=[(b'text/plain', b'Text'), (b'text/html', b'HTML')])),
                ('subject_template', models.CharField(max_length=2000, validators=[emailmessagetemplates.fields.validate_template_syntax])),
                ('body_template_html', models.TextField(blank=True, verbose_name=b'HTML body template', validators=[emailmessagetemplates.fields.validate_template_syntax])),
                ('autogenerate_text', models.BooleanField(default=True, help_text=b"If checked, this option will cause a plain text version of the HTML email to automatically be created when it is sent.  If you'd like to write the plain text template manually, uncheck this box.")),
                ('body_template', models.TextField(blank=True, validators=[emailmessagetemplates.fields.validate_template_syntax])),
                ('sender', models.EmailField(default=b'', help_text=b"The address this email should appear to be sent 'from'.  If blank, defaults to 'None'.", max_length=75, verbose_name=b"'From' Email", blank=True)),
                ('base_cc', emailmessagetemplates.fields.SeparatedValuesField(default=b'', help_text=b'An optional list of email addresses to be CCed when this template is sent (in addition to any addresses specified when the message is sent)', verbose_name=b'CC', blank=True)),
                ('base_bcc', emailmessagetemplates.fields.SeparatedValuesField(default=b'', help_text=b'An optional list of email addresses to be BCCed when this template is sent (in addition to any addresses specified when the message is sent)', verbose_name=b'BCC', blank=True)),
                ('description', models.TextField()),
                ('enabled', models.BooleanField(default=True, help_text=b'When unchecked, this email will not be sent.')),
                ('edited_date', models.DateTimeField(auto_now=True)),
                ('edited_user', models.TextField(max_length=30, editable=False, blank=True)),
                ('content_type', models.ForeignKey(verbose_name=b'Related Object Type', blank=True, to='contenttypes.ContentType', null=True)),
            ],
            options={
                'ordering': ('name',),
                'verbose_name': 'Email Template',
            },
            bases=(models.Model, django.core.mail.message.EmailMultiAlternatives),
        ),
        migrations.AlterUniqueTogether(
            name='emailmessagetemplate',
            unique_together=set([('name', 'content_type', 'object_id')]),
        ),
    ]
