1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
theorangeone.net-legacy/project/common/forms.py

17 lines
728 B
Python
Raw Normal View History

2016-01-14 20:01:47 +00:00
from django import forms
2016-01-24 19:54:57 +00:00
from django_dbq.models import Job
2016-01-14 20:01:47 +00:00
2016-01-14 19:24:24 +00:00
class ContactForm(forms.Form):
email = forms.CharField(label="Email Address", widget=forms.EmailInput(attrs={'placeholder': 'Email Address'}))
name = forms.CharField(label="Full Name", widget=forms.TextInput(attrs={'placeholder': 'Full Name'}))
message = forms.CharField(label="Message", widget=forms.Textarea(attrs={'placeholder': 'Enter your message here'}))
def send_email(self):
2016-01-24 19:54:57 +00:00
Job.objects.create(name='send_email', workspace={
'context': self.cleaned_data,
'to_email': 'info@theorangeone.net',
'from_email': self.cleaned_data['email'],
'template': 'email/contact_message.html'
})