def _send_payment_receipt(self, invoice, payment_record):
     from corehq.apps.accounting.tasks import send_purchase_receipt
     receipt_email_template = 'accounting/email/invoice_receipt.html'
     receipt_email_template_plaintext = 'accounting/email/invoice_receipt.txt'
     try:
         domain = invoice.subscription.subscriber.domain
         context = {
             'invoicing_contact_email':
             settings.INVOICING_CONTACT_EMAIL,
             'balance':
             fmt_dollar_amount(invoice.balance),
             'is_paid':
             invoice.is_paid,
             'date_due':
             invoice.date_due.strftime(USER_DATE_FORMAT)
             if invoice.date_due else 'None',
             'invoice_num':
             invoice.invoice_number,
         }
         send_purchase_receipt.delay(
             payment_record,
             domain,
             receipt_email_template,
             receipt_email_template_plaintext,
             context,
         )
     except:
         self._handle_email_failure(payment_record)
 def send_email(self, payment_record):
     additional_context = self.get_email_context()
     from corehq.apps.accounting.tasks import send_purchase_receipt
     send_purchase_receipt.delay(
         payment_record, self.core_product, self.domain, self.receipt_email_template,
         self.receipt_email_template_plaintext, additional_context
     )
 def send_email(self, payment_record):
     additional_context = self.get_email_context()
     from corehq.apps.accounting.tasks import send_purchase_receipt
     send_purchase_receipt.delay(payment_record, self.domain,
                                 self.receipt_email_template,
                                 self.receipt_email_template_plaintext,
                                 additional_context)
Exemple #4
0
 def _send_payment_receipt(self, invoice, payment_record):
     from corehq.apps.accounting.tasks import send_purchase_receipt
     receipt_email_template = 'accounting/invoice_receipt_email.html'
     receipt_email_template_plaintext = 'accounting/invoice_receipt_email_plaintext.txt'
     try:
         domain = invoice.subscription.subscriber.domain
         context = {
             'invoicing_contact_email': settings.INVOICING_CONTACT_EMAIL,
             'balance': fmt_dollar_amount(invoice.balance),
             'is_paid': invoice.is_paid,
             'date_due': invoice.date_due.strftime(USER_DATE_FORMAT) if invoice.date_due else 'None',
             'invoice_num': invoice.invoice_number,
         }
         send_purchase_receipt.delay(
             payment_record, domain, receipt_email_template, receipt_email_template_plaintext, context,
         )
     except:
         self._handle_email_failure(payment_record)