-
Notifications
You must be signed in to change notification settings - Fork 0
/
couponemail.py
26 lines (23 loc) · 966 Bytes
/
couponemail.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import webapp2
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext.webapp import util, template
from google.appengine.ext import db
from google.appengine.api import mail
from appengine_utilities import sessions
import datetime
from google.appengine.api import users
from restaurantcom import RestaurantcomCoupon
from search import YelpRestaurant
class EmailHandler(webapp2.RequestHandler):
def get(self, page):
restaurant = YelpRestaurant.get_by_key_name(page)
restcom_coupon = RestaurantcomCoupon.all().filter('yelpid =', page)
email = 'baptiste.picard@gmail.com'
template_values = {
'restaurant': restaurant,
'restcom_coupon': restcom_coupon,
'email': email,
}
self.response.out.write(template.render('templates/Recommendation_Email.html', template_values))
app = webapp2.WSGIApplication([
('/email/(.+)', EmailHandler)], debug=True)