Skip to content

Django class-based view and form to send emails.

License

Notifications You must be signed in to change notification settings

thecut/thecut-emailform

Repository files navigation

thecut-emailform

Documentation Status

Django class-based view and form to send enquiry emails.

Features

  • 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, and Reply-To.

Documentation

The full documentation is at https://thecut-emailform.readthedocs.org.

Quickstart

  1. Install thecut-emailform using the :ref:`installation`.

  2. 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 protected]']
    
  3. 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)
    

Credits

See AUTHORS.rst.

About

Django class-based view and form to send emails.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages