def send_email(to, subject, template, **kwargs):
"""Send email using either Celery, or Thread.
Selection depends on CELERY_INSTEAD_THREADING config variable.
"""
app = current_app._get_current_object()
if app.config['CELERY_INSTEAD_THREADING']:
send_email_celery(to, subject, template, countdown=None, **kwargs)
else:
send_email_thread(to, subject, template, **kwargs)
评论列表
文章目录