add email sending functionality with Django Ninja API

This commit is contained in:
2025-05-17 14:12:54 +02:00
parent 17dc04264d
commit da985a47d6
16 changed files with 480 additions and 1 deletions

12
api/models.py Normal file
View File

@@ -0,0 +1,12 @@
from django.db import models
class MailProvider(models.Model):
host = models.URLField()
port = models.IntegerField(default=587)
host_user = models.CharField(max_length=255)
host_password = models.CharField(max_length=255)
use_tls = models.BooleanField(default=True)
from_email = models.EmailField()
def __str__(self):
return f"{self.host} ({self.from_email})"