chore: Synchronisation IMAP

This commit is contained in:
N3WT DE COMPET
2025-05-27 19:59:53 +02:00
parent c5248d9fd3
commit 39d6a8e909
14 changed files with 187 additions and 47 deletions

View File

@ -4,14 +4,22 @@ from django.utils.translation import gettext_lazy as _
from django.conf import settings
from Establishment.models import Establishment
class SMTPSettings(models.Model):
class MailSettings(models.Model):
establishment = models.ForeignKey(Establishment, on_delete=models.CASCADE)
# Paramètres communs (si tu veux un seul user/pass pour SMTP et IMAP)
mail_user = models.CharField(max_length=255)
mail_password = models.CharField(max_length=255)
# SMTP
smtp_server = models.CharField(max_length=255)
smtp_port = models.PositiveIntegerField()
smtp_user = models.CharField(max_length=255)
smtp_password = models.CharField(max_length=255)
use_tls = models.BooleanField(default=True)
use_ssl = models.BooleanField(default=False)
# IMAP
imap_server = models.CharField(max_length=255)
imap_port = models.PositiveIntegerField(default=993)
def __str__(self):
return f"SMTP Settings ({self.smtp_server}:{self.smtp_port})"
return f"MailSettings ({self.establishment} - {self.mail_user})"