@task
def send_purchase_receipt(contrib_id, **kw):
 contrib = Contribution.objects.get(pk=contrib_id)
 with contrib.user.activate_lang():
  addon = contrib.addon
  version = (addon.current_version or addon.latest_version)
  subject = _('Receipt for {0}').format(contrib.addon.name)
  data = {'app_name': addon.name, 'developer_name': (version.developer_name if version else ''), 'price': contrib.get_amount_locale(get_locale_from_lang(contrib.source_locale)), 'date': jingo.helpers.datetime(contrib.created.date()), 'purchaser_email': contrib.user.email, 'transaction_id': contrib.uuid, 'purchases_url': absolutify('/purchases'), 'support_url': addon.support_url, 'terms_of_service_url': absolutify('/terms-of-use')}
  log.info(('Sending email about purchase: %s' % contrib_id))
  text_template = 'purchase/receipt.ltxt'
  html_template = 'purchase/receipt.html'
  send_html_mail_jinja(subject, html_template, text_template, data, recipient_list=[contrib.user.email])

@ task def send_purchase_receipt ( contrib_id , ** kw ) : contrib = Contribution . objects . get ( pk = contrib_id ) with contrib . user . activate_lang ( ) : addon = contrib . addon version = ( addon . current_version or addon . latest_version ) subject = _ ( 'Receipt for {0}' ) . format ( contrib . addon . name ) data = { 'app_name' : addon . name , 'developer_name' : ( version . developer_name if version else '' ) , 'price' : contrib . get_amount_locale ( get_locale_from_lang ( contrib . source_locale ) ) , 'date' : jingo . helpers . datetime ( contrib . created . date ( ) ) , 'purchaser_email' : contrib . user . email , 'transaction_id' : contrib . uuid , 'purchases_url' : absolutify ( '/purchases' ) , 'support_url' : addon . support_url , 'terms_of_service_url' : absolutify ( '/terms-of-use' ) } log . info ( ( 'Sending email about purchase: %s' % contrib_id ) ) text_template = 'purchase/receipt.ltxt' html_template = 'purchase/receipt.html' send_html_mail_jinja ( subject , html_template , text_template , data , recipient_list = [ contrib . user . email ] )
sends an email to the purchaser of the app .