Added contact information to variables table

This commit is contained in:
Zakary Timson 2018-02-22 10:26:39 -05:00
parent 67cb027e2c
commit 063edee463
2 changed files with 6 additions and 23 deletions

View File

@ -140,27 +140,7 @@
</div> </div>
<div class="col-lg-7 py-5" style="background-color: rgba(0, 63, 120, 0.8)"> <div class="col-lg-7 py-5" style="background-color: rgba(0, 63, 120, 0.8)">
<div class="col-lg-8 pl-4"> <div class="col-lg-8 pl-4">
P.O. BOX 33010 {{ contact.value|safe }}
<br>
LAKEVIEW R.O.
<br>
WINDSOR, ONTARIO
<br>
N8Y 0A2
<br>
Phone: (519) 566-1677
<br>
Fax: 1-226-318-0665
<br>
Email Care of David A. Sandor, Barrister & Solicitor, Acting Director:
<br>
{{ contact }}
<br>
<br>
<br>
For any general inquiries, please fill in the following contact form:
<br>
<br>
<div class="form-row"> <div class="form-row">
<div id="contact-success" class="col-12 collapse" aria-expanded="false"> <div id="contact-success" class="col-12 collapse" aria-expanded="false">
<div class=" alert alert-success">Successfully sent email!</div> <div class=" alert alert-success">Successfully sent email!</div>

View File

@ -21,7 +21,8 @@ def index(request):
popup_header = Variable.objects.get(key='popup_header') popup_header = Variable.objects.get(key='popup_header')
popup_body = Variable.objects.get(key='popup_body') popup_body = Variable.objects.get(key='popup_body')
objectives = Variable.objects.get(key='objectives') objectives = Variable.objects.get(key='objectives')
return render(request, 'index.html', {'attorneys': attorneys, 'contact': settings.EMAIL_CONTACT, 'youtube': settings.YOUTUBE_CONFERENCE, 'banner': banner, 'objectives': objectives, 'popup_header': popup_header, 'popup_body': popup_body}) contact = Variable.objects.get(key='contact')
return render(request, 'index.html', {'attorneys': attorneys, 'youtube': settings.YOUTUBE_CONFERENCE, 'banner': banner, 'objectives': objectives, 'popup_header': popup_header, 'popup_body': popup_body, 'contact': contact})
def contact(request): def contact(request):
@ -30,9 +31,11 @@ def contact(request):
subject = request.POST.get('subject') subject = request.POST.get('subject')
body = request.POST.get('body') body = request.POST.get('body')
contact_email = Variable.objects.get(key='contact_email')
result = False result = False
if name is not None and email is not None and subject is not None and body is not None: if name is not None and email is not None and subject is not None and body is not None:
result = mail.send_mail('OACPL CONTACT: %(subject)s' % locals(), body, settings.EMAIL_HOST_USER, [settings.EMAIL_CONTACT], result = mail.send_mail('OACPL CONTACT: %(subject)s' % locals(), body, settings.EMAIL_HOST_USER, [contact_email],
html_message=url_fix_render_to_string('email.html', {'content': '<strong>Someone has messaged you via the website contact form!<br><br>Subject:</strong> %(subject)s<br><strong>From:</strong> %(name)s <%(email)s><br><br>%(body)s' % locals(), 'signature': ' '})) html_message=url_fix_render_to_string('email.html', {'content': '<strong>Someone has messaged you via the website contact form!<br><br>Subject:</strong> %(subject)s<br><strong>From:</strong> %(name)s <%(email)s><br><br>%(body)s' % locals(), 'signature': ' '}))
return JsonResponse({'success': True if result else False}) return JsonResponse({'success': True if result else False})