From: Aleksander Łukasz Date: Tue, 25 Jun 2013 10:05:17 +0000 (+0200) Subject: crowdfunding: sending thank-you email X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/2ae6c6bc078cdc7ec6e3131bbbb430714bf36230?ds=sidebyside;hp=e34fd1a772c0b534073adba2377502eced4d36ae crowdfunding: sending thank-you email --- diff --git a/apps/funding/locale/pl/LC_MESSAGES/django.mo b/apps/funding/locale/pl/LC_MESSAGES/django.mo index 2b31a6183..e2cc75756 100644 Binary files a/apps/funding/locale/pl/LC_MESSAGES/django.mo and b/apps/funding/locale/pl/LC_MESSAGES/django.mo differ diff --git a/apps/funding/locale/pl/LC_MESSAGES/django.po b/apps/funding/locale/pl/LC_MESSAGES/django.po index a8421b172..0543b8ac8 100644 --- a/apps/funding/locale/pl/LC_MESSAGES/django.po +++ b/apps/funding/locale/pl/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-06-21 16:32+0200\n" +"POT-Creation-Date: 2013-06-25 11:55+0200\n" "PO-Revision-Date: 2013-04-25 13:03+0100\n" "Last-Translator: Radek Czajka \n" "Language-Team: LANGUAGE \n" @@ -42,122 +42,159 @@ msgstr "" "Użyjemy go do kontaktu w sprawie prezentów i informacji o zmianach statusu " "zbiórki i kolejnych akcjach.
Nie będzie publikowany." -#: models.py:16 +#: models.py:19 msgid "author" msgstr "autor" -#: models.py:17 +#: models.py:20 msgid "title" msgstr "tytuł" -#: models.py:18 +#: models.py:21 msgid "slug" msgstr "slug" -#: models.py:19 models.py:114 +#: models.py:22 models.py:117 msgid "description" msgstr "opis" -#: models.py:20 +#: models.py:23 msgid "target" msgstr "kwota docelowa" -#: models.py:21 +#: models.py:24 msgid "start" msgstr "początek" -#: models.py:22 +#: models.py:25 msgid "end" msgstr "koniec" -#: models.py:23 +#: models.py:26 msgid "due" msgstr "data publikacji" -#: models.py:24 +#: models.py:27 msgid "When will it be published if the money is raised." msgstr "Kiedy książka zostanie opublikowana, jeśli uda się zebrać pieniądze." -#: models.py:25 +#: models.py:28 msgid "redakcja URL" msgstr "URL na Redakcji" -#: models.py:27 +#: models.py:30 msgid "Published book." msgstr "Opublikowana książka." -#: models.py:28 +#: models.py:31 msgid "Cover" msgstr "Okładka" -#: models.py:29 +#: models.py:32 msgid "Poll" msgstr "Ankieta" -#: models.py:33 +#: models.py:36 msgid "Cover preview" msgstr "Podgląd okładki" -#: models.py:37 models.py:111 models.py:132 +#: models.py:40 models.py:114 models.py:135 msgid "offer" msgstr "zbiórka" -#: models.py:38 +#: models.py:41 msgid "offers" msgstr "zbiórki" -#: models.py:112 +#: models.py:115 msgid "price" msgstr "cena" -#: models.py:113 models.py:133 +#: models.py:116 models.py:136 msgid "name" msgstr "nazwa" -#: models.py:115 +#: models.py:118 msgid "end date" msgstr "data końcowa" -#: models.py:118 +#: models.py:121 msgid "perk" msgstr "prezent" -#: models.py:119 models.py:137 +#: models.py:122 models.py:140 msgid "perks" msgstr "prezenty" -#: models.py:134 +#: models.py:137 msgid "email" msgstr "e-mail" -#: models.py:135 models.py:164 +#: models.py:138 models.py:167 msgid "amount" msgstr "kwota" -#: models.py:136 +#: models.py:139 msgid "payed at" msgstr "data wpłaty" -#: models.py:147 +#: models.py:150 msgid "funding" msgstr "wpłata" -#: models.py:148 +#: models.py:151 msgid "fundings" msgstr "wpłaty" -#: models.py:165 +#: models.py:168 msgid "when" msgstr "kiedy" -#: models.py:168 +#: models.py:171 msgid "money spent on a book" msgstr "pieniądze wydane na książkę" -#: models.py:169 +#: models.py:172 msgid "money spent on books" msgstr "pieniądze wydane na książki" +#: models.py:202 templates/funding/thanks.html:6 +#: templates/funding/thanks.html.py:13 +msgid "Thank you for your support!" +msgstr "Dziękujemy za Twoje wsparcie!" + +#: templates/funding/email.txt:3 +msgid "Hi" +msgstr "Cześć" + +#: templates/funding/email.txt:5 +msgid "" +"Thank you for your support - thanks to you we will set another book free." +msgstr "Dziękujemy za wsparcie - dzięki Tobie uwolnimy kolejną książkę." + +#: templates/funding/email.txt:7 +msgid "The book will be supplemented with your name as a donor." +msgstr "" +"Twoje imię i nazwisko lub pseudonim zostaną dodane do listy darczyńców przy " +"opublikowanej książce." + +#: templates/funding/email.txt:9 +msgid "" +"We will contact you to keep you informed about your perks,\n" +"status changes to this fundraiser and the incoming ones that we plan to " +"launch." +msgstr "" +"Skontaktujemy się Tobą w sprawie prezentów i informacji o zmianach statusu " +"zbiórki oraz kolejnych akcjach." + +#: templates/funding/email.txt:12 +msgid "" +"Cheers,\n" +"Wolne Lektury team" +msgstr "" +"Pozdrawiamy,\n" +"zespół Wolnych Lektur" + #: templates/funding/no_thanks.html:5 templates/funding/no_thanks.html.py:9 msgid "Payment failed" msgstr "Płatność nie doszła do skutku" @@ -226,10 +263,6 @@ msgstr "Aktualna zbiórka:" msgid "Previous fundraisers:" msgstr "Poprzednie zbiórki:" -#: templates/funding/thanks.html:6 templates/funding/thanks.html.py:13 -msgid "Thank you for your support!" -msgstr "Dziękujemy za Twoje wsparcie!" - #: templates/funding/thanks.html:10 msgid "Thank you!" msgstr "Dziękujemy!" diff --git a/apps/funding/models.py b/apps/funding/models.py index 162d33739..0e05e1dcd 100644 --- a/apps/funding/models.py +++ b/apps/funding/models.py @@ -4,6 +4,9 @@ # from datetime import date, datetime from django.core.urlresolvers import reverse +from django.core.mail import send_mail +from django.conf import settings +from django.template.loader import render_to_string from django.db import models from django.utils.translation import ugettext_lazy as _, ugettext as __ import getpaid @@ -190,4 +193,15 @@ def payment_status_changed_listener(sender, instance, old_status, new_status, ** if old_status != 'paid' and new_status == 'paid': instance.order.payed_at = datetime.now() instance.order.save() + if instance.order.email: + send_thank_you_email(instance.order.name, instance.order.email) getpaid.signals.payment_status_changed.connect(payment_status_changed_listener) + +def send_thank_you_email(name, address): + send_mail(_('Thank you for your support!'), + render_to_string('funding/email.txt', dict(name = name)), + getattr(settings, 'CONTACT_EMAIL', 'wolnelektury@nowoczesnapolska.org.pl'), + [address], + fail_silently=False + ) + diff --git a/apps/funding/templates/funding/email.txt b/apps/funding/templates/funding/email.txt new file mode 100644 index 000000000..e5487671d --- /dev/null +++ b/apps/funding/templates/funding/email.txt @@ -0,0 +1,13 @@ +{% load i18n %} + +{% trans 'Hi' %}{% if name %} {{name}}{% endif %}, + +{% trans 'Thank you for your support - thanks to you we will set another book free.' %}{% if name %} + +{% trans 'The book will be supplemented with your name as a donor.' %}{% endif %} + +{% blocktrans %}We will contact you to keep you informed about your perks, +status changes to this fundraiser and the incoming ones that we plan to launch.{% endblocktrans %} + +{% blocktrans %}Cheers, +Wolne Lektury team{% endblocktrans %}