Django class-based view and form to send enquiry emails.
- Send emails using a regular Django form.
- Use Django templates to generate your email's body.
- Send HTML / multi-part emails.
- Add email headers like
Cc
,Bcc
, andReply-To
.
The full documentation is at https://thecut-emailform.readthedocs.org.
Install
thecut-emailform
using the :ref:`installation`.Create a new form based on :py:class:`thecut.emailform.forms.BaseEmailForm`:
class MyEmailForm(BaseEmailForm): # Changing the email address / addresses the email is sent to. to_emails = ['email@example.com']
Use your new form in a view:
class MyView(FormView): form_class = MyEmailForm def form_valid(self, form): form.send_email() return super(MyView, self).form_valid(form)
See AUTHORS.rst
.