diff --git a/event_mail/README.rst b/event_mail/README.rst new file mode 100644 index 000000000..844d1641a --- /dev/null +++ b/event_mail/README.rst @@ -0,0 +1,33 @@ +============== +Event Mail v10 +============== +Event mail adds the functionality to send email notification to the customer at the time of event order confirmation. + +Features +======== +* Customize your own templates for mail. +* Default template for order confirmation. +* Send notification email to customer when an event order is confirmed. + +License +======= +GNU LESSER GENERAL PUBLIC LICENSE, Version 3 (LGPLv3) +(http://www.gnu.org/licenses/agpl.html) + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + + +Contributors +============ + +* Avinash Nk + + +Maintainer +========== + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com diff --git a/event_mail/__init__.py b/event_mail/__init__.py new file mode 100644 index 000000000..ed7da4c8c --- /dev/null +++ b/event_mail/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import models diff --git a/event_mail/__manifest__.py b/event_mail/__manifest__.py new file mode 100644 index 000000000..62b402070 --- /dev/null +++ b/event_mail/__manifest__.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': 'Event Mail', + 'version': '10.0.1.0.0', + 'summary': """Send Email Notification to the Customer at the Time of Event Order Confirmation.""", + 'description': """Send Email Notification to the Customer at the Time of Event Order Confirmation.""", + "category": "Tools", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['event_management'], + 'data': ['data/event_mail_template.xml', + 'views/event_mail.xml', + ], + 'demo': [ + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'application': False, +} diff --git a/event_mail/data/event_mail_template.xml b/event_mail/data/event_mail_template.xml new file mode 100644 index 000000000..790650def --- /dev/null +++ b/event_mail/data/event_mail_template.xml @@ -0,0 +1,113 @@ + + + + + + + + Event Confirmation - Send by Email + ${(object.create_uid.email and '%s <%s>' % (object.create_uid.name, object.create_uid.email) or '')|safe} + ${object.create_uid.company_id.name} Event Confirmation (Ref ${object.name or 'n/a'}) + ${object.partner_id.id} + + ${object.create_uid.email|safe} + + Event_${(object.name or '').replace('/','_')}} + ${object.partner_id.lang} + Dear ${object.partner_id.name} +% if object.partner_id.parent_id: + (${object.partner_id.parent_id.name}) +% endif +,

+

Your event order is confirmed.(${object.name})

+

Thank you,

+% if object.create_uid and object.create_uid.signature: + ${object.create_uid.signature | safe} +% endif +]]>
+
+ + + + Event Confirmation Email + ${object.subject} + + + + + % set record = ctx.get('record') + % set company = record and record.company_id or user.company_id + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + Event ${object.record_name} + + + ${company.name} +
+
+ + + + +
+ ${object.body | safe} +
+
+ + + + + +
+ ${company.name}
+ ${company.phone or ''} +
+ % if company.email: + ${company.email}
+ % endif + % if company.website: + + ${company.website} + + % endif +
+
+ Powered by Odoo. +
+ + + ]]>
+
+ +
+
diff --git a/event_mail/models/__init__.py b/event_mail/models/__init__.py new file mode 100644 index 000000000..e54269ead --- /dev/null +++ b/event_mail/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import event_mail diff --git a/event_mail/models/event_mail.py b/event_mail/models/event_mail.py new file mode 100644 index 000000000..c9ba65c39 --- /dev/null +++ b/event_mail/models/event_mail.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from odoo import models, fields, api, _ + + +class EventManagementMail(models.Model): + _inherit = 'event.management' + + sent = fields.Boolean(string="Sent", copy=False, help="It indicates that the mail has been sent.") + + @api.multi + def send_confirmation_mail(self): + """ Open a window to compose an email, with the event mail template + message loaded by default + """ + self.ensure_one() + template = self.env.ref('event_mail.email_template_event', False) + compose_form = self.env.ref('mail.email_compose_message_wizard_form', False) + ctx = dict( + default_model='event.management', + default_res_id=self.id, + default_use_template=bool(template), + default_template_id=template and template.id or False, + default_composition_mode='comment', + mark_invoice_as_sent=True, + custom_layout="event_mail.mail_template_event_confirmation" + ) + return { + 'name': _('Compose Email'), + 'type': 'ir.actions.act_window', + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'mail.compose.message', + 'views': [(compose_form.id, 'form')], + 'view_id': compose_form.id, + 'target': 'new', + 'context': ctx, + } + + @api.model + def message_get_reply_to(self, res_ids, default=None): + event = self.sudo().browse(res_ids) + reply_to = event.create_uid.email + event.write({'sent': True}) + return {res_ids[0]: reply_to} diff --git a/event_mail/static/description/banner.jpg b/event_mail/static/description/banner.jpg new file mode 100644 index 000000000..9c85bb0d0 Binary files /dev/null and b/event_mail/static/description/banner.jpg differ diff --git a/event_mail/static/description/cybro_logo.png b/event_mail/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/event_mail/static/description/cybro_logo.png differ diff --git a/event_mail/static/description/event_mail_button.png b/event_mail/static/description/event_mail_button.png new file mode 100644 index 000000000..f3bd0662f Binary files /dev/null and b/event_mail/static/description/event_mail_button.png differ diff --git a/event_mail/static/description/event_mail_wizard.png b/event_mail/static/description/event_mail_wizard.png new file mode 100644 index 000000000..9816a36d2 Binary files /dev/null and b/event_mail/static/description/event_mail_wizard.png differ diff --git a/event_mail/static/description/index.html b/event_mail/static/description/index.html new file mode 100644 index 000000000..70241bf0e --- /dev/null +++ b/event_mail/static/description/index.html @@ -0,0 +1,74 @@ +
+
+
+

Event Mail

+

Email Notification for customers at the time of event order confirmation.

+

Cybrosys Technologies

+
+
+

Major Features:

+
    +
  •    Customize your own templates for mail.
  • +
  •    Default template for order confirmation.
  • +
  •    Send notification email to customer when an event order is confirmed.
  • +
+
+
+
+ +
+
+
+

Overview

+

Event mail adds the functionality to send email notification to the customer at the time of event order confirmation.

+
+
+
+ +
+
+
+

Mail Button

+
+ +
+
+
+
+ +
+
+
+

Mail Wizard

+
+ +
+
+
+
+ +
+

Need Any Help?

+ +
diff --git a/event_mail/static/src/img/icon.png b/event_mail/static/src/img/icon.png new file mode 100644 index 000000000..362705d06 Binary files /dev/null and b/event_mail/static/src/img/icon.png differ diff --git a/event_mail/views/event_mail.xml b/event_mail/views/event_mail.xml new file mode 100644 index 000000000..4c38f0ee4 --- /dev/null +++ b/event_mail/views/event_mail.xml @@ -0,0 +1,21 @@ + + + + + event_management_form_view_mail.form + event.management + + +
+
+ + + + + + +
+ +