Lithium contact app¶
Lithium contact is a simple contact form allowing users of your website to easily contact you via email.
Quick start guide¶
To get started using the contact
app, follow these steps:
Install the blog app by adding
'lithium.contact'
toINSTALLED_APPS
.Add the contact app’s URLs to your project’s
urls.py
:urlpatterns = patterns('', ... url(r'^contact/', include('lithium.contact.urls')), ... )Add your email address to the
MANAGERS
section ofsettings.py
:MANAGERS = ( ('Kyle Fuller', 'inbox@kylefuller.co.uk'), )
Using your own templates¶
contact/contact_email.txt
¶
This template is used to render the email before it is sent. The template context will contain the following:
sender
: The sender’s email address.subject
: The sender’s subject.message
: The sender’s message.recipients
: This is a list of who the email is being sent to.
contact/contact_form.html
¶
This template gets passed a django.forms.Form
via the context form
. This template should render the form, and display any validation errors if there were any.
Rendering a custom form¶
A complete form might look like:
<form action="{% url contact_form %}" method="post">
{{ form.as_p }}
<input type="submit" value="Submit" />
</form>
contact/contact_confirmation.html
¶
This template shows a confirmation to the user that there message has been sent.