diff --git a/apps/notification/management/commands/send_certificates.py b/apps/notification/management/commands/send_certificates.py index 639cb21e..343b451b 100644 --- a/apps/notification/management/commands/send_certificates.py +++ b/apps/notification/management/commands/send_certificates.py @@ -1,4 +1,5 @@ from django.core.management.base import BaseCommand +from email.mime.image import MIMEImage from apps.notification.utils import send_email @@ -7,4 +8,4 @@ class Command(BaseCommand): help = 'Send certificates at the end of subscription' def handle(self, *args, **options): - pass + image = MIMEImage(cms.image.open().read()) diff --git a/apps/notification/models.py b/apps/notification/models.py new file mode 100644 index 00000000..6e4e18f5 --- /dev/null +++ b/apps/notification/models.py @@ -0,0 +1,10 @@ +from django.db import models +from django.contrib.auth import get_user_model + + +User = get_user_model() + +class UserNotification(models.Model): + user = models.ForeignKey(User, on_delete=models.CASCADE) + certificate_number = models.SmallIntegerField(blank=True, null=True) + certificate_last_email = models.DateTimeField(blank=True, null=True)