email.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:PilosusBot 作者: pilosus 项目源码 文件源码
def send_email_celery(to, subject, template, countdown=None, **kwargs):
    """Send async email using Celery.
    """
    app = current_app._get_current_object()
    msg = Message(app.config['APP_MAIL_SUBJECT_PREFIX'] + ' ' + subject,
                  sender=app.config['APP_MAIL_SENDER'], recipients=[to])
    msg.body = render_template(template + '.txt', **kwargs)
    msg.html = render_template(template + '.html', **kwargs)
    send_celery_async_email.apply_async(args=[msg], countdown=countdown)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号