Пример #1
0
def get_donation_status_change_text(donation):
    donation_url = reverse_with_site_url(
        'donations:my-renewals', kwargs={
            'id': donation.subscription.id
        }) if donation.is_recurring else reverse_with_site_url(
            'donations:my-onetime-donations')
    if donation.user:
        url_text = str(
            _('Sign into our support page (click "forgot password?" if you have trouble logging in) to view your updated donation(%(url)s).'
              ) % {'url': donation_url}) + "\n"
    else:
        url_text = ''
    return _("""ONE-OFF DONATION STATUS UPDATED\n
\n
Dear %(name)s,\n
%(url_text)s
Details of your donation:\n
\n
Transaction ID: %(transaction_id)s\n
Donation frequency: %(frequency)s\n
Payment method: %(gateway)s\n
Donation amount: %(amount)s\n
Payment status: %(status)s\n
\n
Thank you,\n
%(sitename)s""") % {
        'name': donation.donor_name(),
        'url_text': url_text,
        'transaction_id': donation.transaction_id,
        'frequency': donation.donation_frequency,
        'gateway': displayGateway(donation),
        'amount': displayDonationAmountWithCurrency(donation),
        'status': donation.payment_status,
        'sitename': get_site_name()
    }
Пример #2
0
def get_donation_receipt_text(donation):
    donation_url = reverse_with_site_url(
        'donations:my-recurring-donations'
    ) if donation.is_recurring else reverse_with_site_url(
        'donations:my-onetime-donations')
    if donation.user:
        url_text = str(
            _('Sign into our support page (click "forgot password?" if you have trouble logging in) to view your donation(%(url)s). Please email [email protected] if you have any further enquiries.'
              ) % {'url': donation_url})
    else:
        url_text = ''
    return _("""NEW ONE-OFF DONATION\n
\n
Dear %(name)s,\n
A big "thank you" for your kind %(amount)s donation - it is very much appreciated and it will go a long way in supporting our operations.\n
Your contribution will be well-spent, allowing us to invest more in original reporting and safeguard press freedom. Please check out HKFP's latest Annual Report(https://hongkongfp.com/hong-kong-free-press-annual-report-2020/) - it includes our yearly, audited Transparency Report(https://hongkongfp.com/hong-kong-free-press-transparency-report-2019/), so you can see how carefully we spend our income.\n
%(url_text)s\n
From all of us, thank you for helping us keep independent media alive in Hong Kong!\n
Details of your donation:\n
\n
Transaction ID: %(transaction_id)s\n
Donation frequency: %(frequency)s\n
Payment method: %(gateway)s\n
Donation amount: %(amount)s\n
Payment status: %(status)s\n
%(recurring_status)s
\n
Thank you,\n
%(sitename)s""") % {
        'name':
        donation.donor_name(),
        'url_text':
        url_text,
        'transaction_id':
        donation.transaction_id,
        'frequency':
        donation.donation_frequency,
        'gateway':
        displayGateway(donation),
        'amount':
        displayDonationAmountWithCurrency(donation),
        'status':
        donation.payment_status,
        'recurring_status':
        'Recurring Status: ' + donation.subscription.recurring_status +
        "\n" if donation.is_recurring and donation.subscription else '',
        'sitename':
        get_site_name()
    }
Пример #3
0
def get_donation_revoked_donor_text(donation):
    donation_url = reverse_with_site_url(
        'donations:my-recurring-donations'
    ) if donation.is_recurring else reverse_with_site_url(
        'donations:my-onetime-donations')
    if donation.user:
        url_text = str(
            _('Go to %(url)s to view your donation on the website.') %
            {'url': donation_url})
    else:
        url_text = ''
    return _("""DONATION REVOKED\n
\n
Dear %(name)s,\n
Your donation is unfortunately revoked by the payment gateway. %(url_text)s\n
Here are the details of your donation:\n
\n
Transaction ID: %(transaction_id)s\n
Donation frequency: %(frequency)s\n
Payment method: %(gateway)s\n
Donation amount: %(amount)s\n
Payment status: %(status)s\n
%(recurring_status)s
\n
Thank you,\n
%(sitename)s""") % {
        'name':
        donation.donor_name(),
        'url_text':
        url_text,
        'transaction_id':
        donation.transaction_id,
        'frequency':
        donation.donation_frequency,
        'gateway':
        displayGateway(donation),
        'amount':
        displayDonationAmountWithCurrency(donation),
        'status':
        donation.payment_status,
        'recurring_status':
        'Recurring Status: ' + donation.subscription.recurring_status +
        "\n" if donation.is_recurring and donation.subscription else '',
        'sitename':
        get_site_name()
    }
Пример #4
0
def get_donation_revoked_admin_text(donation):
    return _("""A Donation is revoked\n
\n
Hi Admins,\n
This email is to inform you that a donation has been revoked on your website:\n
%(url)s\n
\n
Donor: %(name)s\n
Transaction ID: %(transaction_id)s\n
Donation frequency: %(frequency)s\n
Payment method: %(gateway)s\n
Donation amount: %(amount)s\n
Payment status: %(status)s\n
%(recurring_status)s
\n
Thank you,\n
%(sitename)s""") % {
        'url':
        reverse_with_site_url('donations_donation_modeladmin_inspect',
                              kwargs={'instance_pk': donation.id}),
        'name':
        donation.donor_name(),
        'transaction_id':
        donation.transaction_id,
        'frequency':
        donation.donation_frequency,
        'gateway':
        donation.gateway,
        'amount':
        displayDonationAmountWithCurrency(donation),
        'status':
        donation.payment_status,
        'recurring_status':
        'Recurring Status: ' + donation.subscription.recurring_status +
        "\n" if donation.is_recurring and donation.subscription else '',
        'sitename':
        get_site_name()
    }
Пример #5
0
def amount_with_currency(donation):
    return displayDonationAmountWithCurrency(donation)