Allow to send e-mails to attendees individually (#1299)

* .

* Add a position detail page to the frontend

* Mail templates

* Send mails

* Send reminder email

* Add position support to sendmail plugin

* Add and fix some tests

* Fix failing test on real databases
This commit is contained in:
Raphael Michel
2019-05-24 09:41:44 +02:00
committed by GitHub
parent d22a7844ea
commit f1bce0c08b
29 changed files with 1078 additions and 213 deletions

View File

@@ -401,6 +401,28 @@ class DownloadReminderTests(TestCase):
send_download_reminders(sender=self.event)
assert len(djmail.outbox) == 1
def test_send_to_attendees(self):
self.event.settings.mail_send_download_reminder_attendee = True
self.event.settings.mail_days_download_reminder = 2
self.op1.attendee_email = 'attendee@dummy.test'
self.op1.save()
send_download_reminders(sender=self.event)
assert len(djmail.outbox) == 2
assert djmail.outbox[0].to == ['dummy@dummy.test']
assert djmail.outbox[1].to == ['attendee@dummy.test']
assert '/ticket/' in djmail.outbox[1].body
assert '/order/' not in djmail.outbox[1].body
def test_send_not_to_attendees_with_same_address(self):
self.event.settings.mail_send_download_reminder_attendee = True
self.event.settings.mail_days_download_reminder = 2
self.op1.attendee_email = 'dummy@dummy.test'
self.op1.save()
send_download_reminders(sender=self.event)
assert len(djmail.outbox) == 1
assert djmail.outbox[0].to == ['dummy@dummy.test']
assert '/order/' in djmail.outbox[0].body
def test_sent_paid_only(self):
self.event.settings.mail_days_download_reminder = 2
self.order.status = Order.STATUS_PENDING