diff --git a/odoo_website_helpdesk/__manifest__.py b/odoo_website_helpdesk/__manifest__.py index 02c666fab..26e47837e 100644 --- a/odoo_website_helpdesk/__manifest__.py +++ b/odoo_website_helpdesk/__manifest__.py @@ -21,7 +21,7 @@ ############################################################################ { 'name': "Website Helpdesk Support Ticket Management", - 'version': '17.0.1.0.2', + 'version': '17.0.1.0.3', 'category': 'Website', 'summary': """The website allows for the creation of tickets, which can then be controlled from the backend. Furthermore, a bill that includes diff --git a/odoo_website_helpdesk/controllers/website_form.py b/odoo_website_helpdesk/controllers/website_form.py index a1c841648..1caa2d536 100644 --- a/odoo_website_helpdesk/controllers/website_form.py +++ b/odoo_website_helpdesk/controllers/website_form.py @@ -55,6 +55,7 @@ class WebsiteFormInherit(WebsiteForm): :return: JSON response indicating the success or failure of form submission. :rtype: str """ + print('hiiii') customer = request.env.user.partner_id lowest_stage_id = None if model_name == 'ticket.helpdesk': @@ -105,6 +106,20 @@ class WebsiteFormInherit(WebsiteForm): 'category_id': kwargs.get('category'), } ticket_id = request.env['ticket.helpdesk'].sudo().create(rec_val) + if ticket_id and partner_create.email: + request.env['mail.mail'].sudo().create({ + 'subject': 'Your Ticket Has Been Created', + 'body_html': f"
Hello {partner_create.name},
Your ticket {ticket_id.name} with the subject {ticket_id.subject} has been successfully submitted. Our support team will contact you soon.
Thank You.
", + 'email_to': partner_create.email, + 'email_from': request.env.user.email or 'support@example.com', + }).send() + ticket_id.message_post( + body="A confirmation email regarding the ticket creation has been sent to the customer.", + subject="Ticket Confirmation Email", + message_type='email', + subtype_xmlid="mail.mt_comment", + ) + request.session['ticket_number'] = ticket_id.name request.session['ticket_id'] = ticket_id.id model_record = request.env['ir.model'].sudo().search( diff --git a/odoo_website_helpdesk/doc/RELEASE_NOTES.md b/odoo_website_helpdesk/doc/RELEASE_NOTES.md index 0b5f98864..759f03b67 100644 --- a/odoo_website_helpdesk/doc/RELEASE_NOTES.md +++ b/odoo_website_helpdesk/doc/RELEASE_NOTES.md @@ -15,3 +15,9 @@ ##### UPDT -A new contact record is created upon form submission. +#### 19.05.2025 +#### Version 17.0.1.0.3 +##### UPDT +-A confirmation email will be sent to the customer upon ticket creation. + + diff --git a/odoo_website_helpdesk/static/description/index.html b/odoo_website_helpdesk/static/description/index.html index 9ff5071cd..d6b536e0b 100644 --- a/odoo_website_helpdesk/static/description/index.html +++ b/odoo_website_helpdesk/static/description/index.html @@ -635,6 +635,8 @@ in the Thank You page that appears when the helpdesk ticket is generated. +A confirmation email will be sent to the customer upon ticket creation. +