nagasurendra commited on
Commit
98312f8
·
verified ·
1 Parent(s): c0ffc80

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -1
app.py CHANGED
@@ -68,7 +68,23 @@ def generate_coupon_code(length=10):
68
  import re
69
 
70
  import re
71
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  @app.route("/order-history", methods=["GET"])
73
  def order_history():
74
  email = session.get('user_email') # Get logged-in user's email
 
68
  import re
69
 
70
  import re
71
+ @app.route('/customer_details')
72
+ def customer_details():
73
+ email = session.get('user_email') # Get logged-in user email from session
74
+
75
+ # Fetch customer details using the email
76
+ customer = get_customer_details_from_db(email) # Query Salesforce or your DB
77
+
78
+ # Create a dictionary with customer details, including referral code and reward points
79
+ customer_data = {
80
+ 'name': customer.Name,
81
+ 'email': customer.Email__c,
82
+ 'phone': customer.Phone_Number__c,
83
+ 'referral_code': customer.Referral__c, # Referral code
84
+ 'reward_points': customer.Reward_Points__c # Reward points
85
+ }
86
+
87
+ return render_template('customer_details.html', customer=customer_data)
88
  @app.route("/order-history", methods=["GET"])
89
  def order_history():
90
  email = session.get('user_email') # Get logged-in user's email