コード例 #1
0
ファイル: utils.py プロジェクト: bfritscher/fablab-admin
def send_invoice(invoice):
    # Initialize message on creation.
    message = EmailMessage('base/mail/invoice.html', {'invoice': invoice}, invoice.seller.email,
                           to=[invoice.buyer.email])

    message.attach_file(invoice.document.path)
    # Send message when ready. It will be rendered automatically if needed.
    message.send()