Remove some old handler-less logic for emails

pretty sure this was only referenced by tailbone, which has been updated
This commit is contained in:
Lance Edgar 2019-02-13 20:52:14 -06:00
parent 332cc6db26
commit 8ae12ca1dc

View file

@ -76,32 +76,7 @@ def send_email(config, key, data={}, attachments=[], fallback_key=None, enabled=
log.debug("skipping email of type '%s' per config", key) log.debug("skipping email of type '%s' per config", key)
# TODO: deprecate / remove this # TODO: deprecate / remove this (used only for tailbone preview?)
def get_email(config, key, fallback_key=None):
"""
Return an email instance of the given type.
"""
for email in iter_emails(config):
if email.key == key or email.__name__ == key:
return email(config, key, fallback_key)
return Email(config, key, fallback_key)
# TODO: deprecate / remove this
def iter_emails(config):
"""
Iterate over all available email types.
"""
for module in config.getlist('rattail.mail', 'emails', default=['rattail.emails']):
module = import_module_path(module)
for name in dir(module):
obj = getattr(module, name)
if (isinstance(obj, type) and issubclass(obj, Email)
and not obj.abstract and obj is not Email):
yield obj
# TODO: deprecate / remove this
def deliver_message(config, key, msg, recipients=UNSPECIFIED): def deliver_message(config, key, msg, recipients=UNSPECIFIED):
""" """
Deliver an email message using the given SMTP configuration. Deliver an email message using the given SMTP configuration.