+ def wl_optout_url(self):
+ return 'https://wolnelektury.pl' + self.get_optout_url()
+
+
+class EmailSent(models.Model):
+ template = models.ForeignKey(EmailTemplate, models.CASCADE)
+ contact = models.ForeignKey(Contact, models.CASCADE)
+ timestamp = models.DateTimeField(auto_now_add=True)
+ subject = models.CharField(_('subject'), max_length=1024)
+ body = models.TextField(_('body'))
+
+ class Meta:
+ verbose_name = _('email sent')
+ verbose_name_plural = _('emails sent')
+ ordering = ('-timestamp',)
+
+ def __str__(self):
+ return '%s %s' % (self.contact.email, self.timestamp)
+