# Path: boxes/models.py
# class Message(models.Model):
# 
#     ONQUEUE = 10
#     SENT = 20
#     FAILED = 30
# 
#     STATUSES = (
#         (ONQUEUE, _('OnQueue')),
#         (SENT, _('Sent')),
#         (FAILED, _('Failed'))
#     )
# 
#     box = models.ForeignKey(
#         "Box", on_delete=models.CASCADE, related_name='messages')
#     status = models.IntegerField(choices=STATUSES, default=ONQUEUE,
#                                  verbose_name=_('Status'))
#     created_at = models.DateTimeField(auto_now_add=True,
#                                       verbose_name=_('Created at'))
#     updated_at = models.DateTimeField(auto_now=True,
#                                       verbose_name=_('Updated at'))
#     sent_at = models.DateTimeField(null=True, blank=True,
#                                    verbose_name=_('Sent at'))


from django.core.mail import EmailMultiAlternatives
from django.conf import settings
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from .models import Message
from celery import shared_task
from __future__ import absolute_import




@shared_task
def process_email(message_id, form_data, sent_by=None):

# Path: boxes/models.py
# class Message(models.Model):
# 
#     ONQUEUE = 10
#     SENT = 20
#     FAILED = 30
# 
#     STATUSES = (
#         (ONQUEUE, _('OnQueue')),
#         (SENT, _('Sent')),
#         (FAILED, _('Failed'))
#     )
# 
#     box = models.ForeignKey(
#         "Box", on_delete=models.CASCADE, related_name='messages')
#     status = models.IntegerField(choices=STATUSES, default=ONQUEUE,
#                                  verbose_name=_('Status'))
#     created_at = models.DateTimeField(auto_now_add=True,
#                                       verbose_name=_('Created at'))
#     updated_at = models.DateTimeField(auto_now=True,
#                                       verbose_name=_('Updated at'))
#     sent_at = models.DateTimeField(null=True, blank=True,
#                                    verbose_name=_('Sent at'))


# Path: boxes/tasks.py
from django.core.mail import EmailMultiAlternatives
from django.conf import settings
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from .models import Message
from celery import shared_task

from __future__ import absolute_import




@shared_task
def process_email(message_id, form_data, sent_by=None):

    message = Message.objects.get(id=message_id)