Plain is headed towards 1.0! Subscribe for development updates →

plain-support

Captcha...

Security considerations

Most support forms allow you to type in an email address. Be careful, because anybody can pretend to be anybody else at this point. Converations either need to continue over email (which confirms they have access to the email account), or include a verification step (emailing a code to the email address, for example).

 1import uuid
 2
 3from plain import models
 4from plain.runtime import settings
 5
 6
 7class SupportFormEntry(models.Model):
 8    uuid = models.UUIDField(default=uuid.uuid4, editable=False, unique=True)
 9    user = models.ForeignKey(
10        settings.AUTH_USER_MODEL,
11        on_delete=models.SET_NULL,
12        related_name="support_form_entries",
13        null=True,
14        blank=True,
15    )
16    name = models.CharField(max_length=255)
17    email = models.EmailField()
18    message = models.TextField()
19    created_at = models.DateTimeField(auto_now_add=True)
20    form_slug = models.CharField(max_length=255)
21    # referrer? source? session?
22    # extra_data
23
24    class Meta:
25        ordering = ["-created_at"]