On Tue, Dec 29, 2009 at 9:40 PM, shacker <shac...@birdhouse.org> wrote:
> The docs and code for ubernostrum's django-contact-form imply that the
> app includes a Subject field by default. But putting {{form}} in
> contact_form.html only gives you name, email address, and message
> fields. It's not clear to me those fields are showing up but the
> Subject field is not. Is subclassing required to get Subject working?
> (and if so, why? - it looks like subject is built in).
>
> Anyone have a recipe for getting this working? Thanks.

The "subject" is not intended to be filled with user input through the web form.
The subject is used internally, you need to setup the "subject template"
to get working right.

Here is the templates that I created in one of my projects:
contact_form/
contact_form/contact_form_subject.txt
contact_form/contact_form.html
contact_form/contact_form_sent.html
contact_form/contact_form.txt

And my contact_form_subject.txt contains something like:
[mysite] message from {{ name }}

The available variables for subject template are the ones of the form:
name, email, body
But I don't think you should use {{ body }} in your subject template.

The contact_form.txt is the email body template, here is mine (in spanish):
=======
Has recibido un nuevo mensaje vía formulario de contacto.

Nombre: {{ name }}
Email: {{ email }}
Mensaje: {{ body }}

--
=======
Site


Hope it helps. Regards,

-- 
Rolando Espinoza La fuente
www.rolandoespinoza.info

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to