def get(self): # look for slots starting in 24 hours, notify them that their slots are empty start_looking = datetime.datetime.now() + datetime.timedelta( minutes=60 * 24) stop_looking = start_looking + datetime.timedelta(minutes=60) slots = TopicSlot.get_between_times(start_looking, stop_looking) for slot in slots: if slot.topic.slot_capacity == 1: return slot_subject = EMPTY_SUBJECT % (slot.topic.title) rsvps = slot.rsvps.fetch(3) if len(rsvps) > 1: return for rsvp in rsvps: if not rsvp.notified_empty: slot_body = EMPTY_BODY % (slot.topic.title, rsvp.local_time, slot.full_link) taskqueue.add(url='/email/send', params={ 'email': rsvp.attendee, 'subject': slot_subject, 'body': slot_body }) rsvp.notified_empty = True rsvp.save()
def get(self): start_looking = datetime.datetime.now() + datetime.timedelta(minutes=120) stop_looking = start_looking + datetime.timedelta(minutes=60) slots = TopicSlot.get_between_times(start_looking, stop_looking) for slot in slots: slot_subject = REMINDER_SUBJECT % (slot.topic.title) for rsvp in slot.rsvps.fetch(10000): if not rsvp.notified: slot_body = REMINDER_BODY % (slot.topic.title, rsvp.local_time, slot.full_link) taskqueue.add(url='/email/reminder', params={'email': rsvp.attendee, 'subject': slot_subject, 'body': slot_body}) rsvp.notified = True rsvp.save()
def get(self): start_looking = datetime.datetime.now() - datetime.timedelta(minutes=5) stop_looking = start_looking + datetime.timedelta(minutes=15) slots = TopicSlot.get_between_times(start_looking, stop_looking) for slot in slots: slot_subject = SETUP_REMINDER_SUBJECT % (slot.topic.title) for rsvp in slot.rsvps.fetch(10000): if not rsvp.notified_setup: slot_body = SETUP_REMINDER_BODY % (slot.topic.title, util.get_host() + '/help/setup', slot.topic.full_link) taskqueue.add(url='/email/send', params={'email': rsvp.attendee, 'subject': slot_subject, 'body': slot_body}) rsvp.notified_setup = True rsvp.save()
def get(self): # look for slots starting in 24 hours, notify them that their slots are empty start_looking = datetime.datetime.now() + datetime.timedelta(minutes=60*24) stop_looking = start_looking + datetime.timedelta(minutes=60) slots = TopicSlot.get_between_times(start_looking, stop_looking) for slot in slots: if slot.topic.slot_capacity == 1: return slot_subject = EMPTY_SUBJECT % (slot.topic.title) rsvps = slot.rsvps.fetch(3) if len(rsvps) > 1: return for rsvp in rsvps: if not rsvp.notified_empty: slot_body = EMPTY_BODY % (slot.topic.title, rsvp.local_time, slot.full_link) taskqueue.add(url='/email/send', params={'email': rsvp.attendee, 'subject': slot_subject, 'body': slot_body}) rsvp.notified_empty = True rsvp.save()
def get(self): start_looking = datetime.datetime.now() + datetime.timedelta( minutes=120) stop_looking = start_looking + datetime.timedelta(minutes=60) slots = TopicSlot.get_between_times(start_looking, stop_looking) for slot in slots: slot_subject = REMINDER_SUBJECT % (slot.topic.title) for rsvp in slot.rsvps.fetch(10000): if not rsvp.notified: slot_body = REMINDER_BODY % ( slot.topic.title, rsvp.local_time, slot.full_link) taskqueue.add(url='/email/reminder', params={ 'email': rsvp.attendee, 'subject': slot_subject, 'body': slot_body }) rsvp.notified = True rsvp.save()
def get(self): start_looking = datetime.datetime.now() - datetime.timedelta(minutes=5) stop_looking = start_looking + datetime.timedelta(minutes=15) slots = TopicSlot.get_between_times(start_looking, stop_looking) for slot in slots: slot_subject = SETUP_REMINDER_SUBJECT % (slot.topic.title) for rsvp in slot.rsvps.fetch(10000): if not rsvp.notified_setup: slot_body = SETUP_REMINDER_BODY % ( slot.topic.title, util.get_host() + '/help/setup', slot.topic.full_link) taskqueue.add(url='/email/send', params={ 'email': rsvp.attendee, 'subject': slot_subject, 'body': slot_body }) rsvp.notified_setup = True rsvp.save()