def send_email(msg): """ Send email, async only if NOTIFICATION_SETTINGS.async_email """ if NOTIFICATION_SETTINGS.async_email: send_email_async(msg) else: MAIL.send(msg)
def with_context(): """ Wrapper to send message with copied context """ MAIL.send(msg)