Esempio n. 1
0
def main(request):
  events = Event.objects.filter(endtime__gte=datetime.datetime.now()).order_by('starttime')
  mail_text = gen_email()
  mail_subject = "Events of the week, %s"%(datetime.date.today().strftime("%m/%d/%y"))

  return render_to_response('intranet/event_manager/main.html',{
    "section":"intranet",
    "page":'event',
    'events':events,
    "mail_text":mail_text,
    "mail_subject":mail_subject,
    "user": request.user
  },context_instance=RequestContext(request))
Esempio n. 2
0
def send_email(request):
  email = gen_email()
  addr = request.user.email
  send_mail('ACM@UIUC Weekly Event Email', email, addr ,['*****@*****.**'], fail_silently=False)
  messages.add_message(request, messages.SUCCESS, "Email Successfully Sent!")
  return HttpResponseRedirect('/intranet/event')