expephalon-kumisms/core/modules/mail.py

15 lines
412 B
Python
Raw Normal View History

from core.classes.mail import SMTPMailProvider
import importlib
from django.conf import settings
providers = { "smtp": SMTPMailProvider }
for module in settings.EXPEPHALON_MODULES:
try:
mom = importlib.import_module(f"{module}.mail")
for name, provider in mom.MAILPROVIDERS.items():
providers[name] = provider
except (AttributeError, ModuleNotFoundError):
continue