forked from alaguraj/odoo-testing-addons
add TableReservationController to handle reservation form rendering, slot availability, and submission logic
This commit is contained in:
parent
214cd34671
commit
32af877129
@ -271,6 +271,8 @@ class TableReservationController(http.Controller):
|
|||||||
|
|
||||||
# Send Emails
|
# Send Emails
|
||||||
try:
|
try:
|
||||||
|
company_email = request.env.company.email or 'info@chennora.ca'
|
||||||
|
|
||||||
# 1. Notify the Company
|
# 1. Notify the Company
|
||||||
admin_mail_values = {
|
admin_mail_values = {
|
||||||
'subject': f"New Table Reservation: {customer_name}",
|
'subject': f"New Table Reservation: {customer_name}",
|
||||||
@ -285,7 +287,7 @@ class TableReservationController(http.Controller):
|
|||||||
</ul>
|
</ul>
|
||||||
""",
|
""",
|
||||||
'email_to': 'alaguraj0361@gmail.com',
|
'email_to': 'alaguraj0361@gmail.com',
|
||||||
'email_from': 'alaguraj0361@gmail.com',
|
'email_from': company_email,
|
||||||
'reply_to': email,
|
'reply_to': email,
|
||||||
}
|
}
|
||||||
admin_mail = request.env['mail.mail'].sudo().create(admin_mail_values)
|
admin_mail = request.env['mail.mail'].sudo().create(admin_mail_values)
|
||||||
@ -308,8 +310,8 @@ class TableReservationController(http.Controller):
|
|||||||
<p>Thank you,<br>Chennora</p>
|
<p>Thank you,<br>Chennora</p>
|
||||||
""",
|
""",
|
||||||
'email_to': email,
|
'email_to': email,
|
||||||
'email_from': 'alaguraj0361@gmail.com',
|
'email_from': company_email,
|
||||||
'reply_to': 'alaguraj0361@gmail.com',
|
'reply_to': 'info@chennora.ca',
|
||||||
}
|
}
|
||||||
customer_mail = request.env['mail.mail'].sudo().create(customer_mail_values)
|
customer_mail = request.env['mail.mail'].sudo().create(customer_mail_values)
|
||||||
customer_mail.send()
|
customer_mail.send()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user