mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 07:53:23 +00:00
chore: Synchronisation IMAP
This commit is contained in:
@ -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})"
|
||||
Reference in New Issue
Block a user