forked from alaguraj/odoo-testing-addons
implement reservation controller with slot generation and table allocation logic, and update docker-compose configuration
This commit is contained in:
parent
ad8c68b16d
commit
2dff231653
@ -268,6 +268,28 @@ class TableReservationController(http.Controller):
|
||||
'end_time': end_time,
|
||||
'state': 'confirmed' # Direct confirmation from website
|
||||
})
|
||||
|
||||
# Send Email
|
||||
try:
|
||||
mail_values = {
|
||||
'subject': f"New Table Reservation: {customer_name}",
|
||||
'body_html': f"""
|
||||
<p>A new table reservation has been submitted successfully.</p>
|
||||
<ul>
|
||||
<li><b>Customer Name:</b> {customer_name}</li>
|
||||
<li><b>Phone:</b> {phone}</li>
|
||||
<li><b>Email:</b> {email}</li>
|
||||
<li><b>Number of Guests:</b> {num_people}</li>
|
||||
<li><b>Time:</b> {start_time_str}</li>
|
||||
</ul>
|
||||
""",
|
||||
'email_to': 'alaguraj0361@gmail.com',
|
||||
}
|
||||
mail = request.env['mail.mail'].sudo().create(mail_values)
|
||||
mail.send()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return request.render("dine360_reservation.reservation_success_template", {
|
||||
'reservation': reservation,
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user