# Path: apps/api_bridge.py
# def getarrivals(request, result_count=3):
# def getparking():


import logging
import webapp2
import config
from google.appengine.api import mail
from google.appengine.api.taskqueue import Task
from apps import api_bridge
      response = response.replace('Route','\nRoute')

      # send back the reply with the results
      header = "Thanks for your request! Here are your results...\n\n"
      footer = "\n\nThank you for using SMSMyBus!\nhttps://www.smsmybus.com"

      # setup the response email
      message = mail.EmailMessage()
      message.sender = config.EMAIL_SENDER_ADDRESS
      #message.bcc = config.EMAIL_BCC_ADDRESS
      message.to = inbound_message.sender
      message.subject = 'Your Metro schedule estimates for stop %s' % getStopID(body)
      message.body = header + response + footer

      logging.debug('sending results to %s' % message.to)
      message.send()

      # create an event to log the event
      task = Task(url='/loggingtask', params={'from':inbound_message.sender,
                                              'to':inbound_message.to,
                                              'inboundBody':body,
                                              'sid':'email',
                                              'outboundBody':response,})
      task.add('eventlogger')

      self.response.set_status(200)
      return

## end EmailRequestHandler


# Path: apps/api_bridge.py
# def getarrivals(request, result_count=3):
# def getparking():


# Path: apps/electric_mail.py
import logging
import webapp2
import config
from google.appengine.api import mail
from google.appengine.api.taskqueue import Task
from apps import api_bridge

      response = response.replace('Route','\nRoute')

      # send back the reply with the results
      header = "Thanks for your request! Here are your results...\n\n"
      footer = "\n\nThank you for using SMSMyBus!\nhttps://www.smsmybus.com"

      # setup the response email
      message = mail.EmailMessage()
      message.sender = config.EMAIL_SENDER_ADDRESS
      #message.bcc = config.EMAIL_BCC_ADDRESS
      message.to = inbound_message.sender
      message.subject = 'Your Metro schedule estimates for stop %s' % getStopID(body)
      message.body = header + response + footer

      logging.debug('sending results to %s' % message.to)
      message.send()

      # create an event to log the event
      task = Task(url='/loggingtask', params={'from':inbound_message.sender,
                                              'to':inbound_message.to,
                                              'inboundBody':body,
                                              'sid':'email',
                                              'outboundBody':response,})
      task.add('eventlogger')

      self.response.set_status(200)
      return

## end EmailRequestHandler


def getStopID(msg):