diff --git a/sendgrid_email/README.rst b/sendgrid_email/README.rst new file mode 100644 index 000000000..bbd2d7607 --- /dev/null +++ b/sendgrid_email/README.rst @@ -0,0 +1,52 @@ +SendGrid Email API +================== + +This module comes under Odoo Email Marketing. +It will Use for Emailing. It could be use for Bulk +Mailing and Single Mailing . Email Template use for +constructing Email Content.It includes Mail reports +and Bounce Checking Option, here user can Konw the mail status. + +Usage +===== + +After the installation,in email marketting settings user can see sendgrid api setting field by ticking in check box a new text field will appear here user can set the API key by saving it key will be save in the system ,in email marketting configuration includes a sub menu sendgrid email template details here user can create email templates . in configuration have another menu called sendgrid from emails this menu is used for creating new from emails for using in malling. in mailing menu create a new mail here user can see a new page view called sendgrid emails here we can set the template and another specifications, using sendgrid button on top user can send the mail. + +Configuration +============= + +For saving the API key configuration have check box field sendgrid api by ticking in check box a new text field will appear here user can set the API key by saving it key will be save in the system. + + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: + Noushid Khan.P + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ + + diff --git a/sendgrid_email/__init__.py b/sendgrid_email/__init__.py new file mode 100644 index 000000000..ab699821c --- /dev/null +++ b/sendgrid_email/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies (). +# Author: Noushid Khan.P () +# +# 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 \ No newline at end of file diff --git a/sendgrid_email/__manifest__.py b/sendgrid_email/__manifest__.py new file mode 100644 index 000000000..e62aca3c9 --- /dev/null +++ b/sendgrid_email/__manifest__.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies (). +# Author: Noushid Khan.P () +# +# 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': 'Mass Mailing With SendGrid', + 'version': '13.0.1.0.0', + 'summary': 'Mass Mailing using SendGrid API', + 'description': 'Mass Mailing using SendGrid API', + 'category': 'Marketing', + 'author': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': [ + 'crm', + 'mass_mailing', + 'base', + 'hr_recruitment', + 'event' + ], + 'data': [ + 'security/ir.model.access.csv', + 'views/view.xml', + 'views/mail_view.xml', + 'views/ir_config_view.xml', + 'views/res_config_view.xml' + ], + 'license': 'AGPL-3', + 'images': ['static/description/banner.png'], + 'installable': True, + 'application': False, + 'auto_install': False, +} diff --git a/sendgrid_email/doc/RELEASE_NOTES.md b/sendgrid_email/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..f95053398 --- /dev/null +++ b/sendgrid_email/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 30.01.2020 +#### Version 13.0.1.0.0 +##### ADD +- Initial commit for sendgrid_email. + diff --git a/sendgrid_email/models/__init__.py b/sendgrid_email/models/__init__.py new file mode 100644 index 000000000..f160143ce --- /dev/null +++ b/sendgrid_email/models/__init__.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies (). +# Author: Noushid Khan.P () +# +# 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 model +from . import email_send +from . import email_template +from . import mail_mail +from . import ir_config_parameter +from . import res_config_settings \ No newline at end of file diff --git a/sendgrid_email/models/email_send.py b/sendgrid_email/models/email_send.py new file mode 100644 index 000000000..6941a4d86 --- /dev/null +++ b/sendgrid_email/models/email_send.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies (). +# Author: Noushid Khan.P () +# +# 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 + + +class EmailDetails(models.Model): + _name = "email.sent" + _description = 'Email From Mails' + + name = fields.Char(string="Name", required=True) + email_id = fields.Char(string="Email ID", required=True) diff --git a/sendgrid_email/models/email_template.py b/sendgrid_email/models/email_template.py new file mode 100644 index 000000000..36cc534f7 --- /dev/null +++ b/sendgrid_email/models/email_template.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies (). +# Author: Noushid Khan.P () +# +# 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 . +# +################################################################################### + +import json + +from odoo import models, fields, _ +import http.client + +from odoo.exceptions import UserError + + +class EmailTemplateDetails(models.Model): + _name = "email.template" + _rec_name = "temp_name" + _description = "Template Creation" + + temp_name = fields.Char(string="Template Name", required=True) + generation = fields.Char(string="Template Generation", default="Dynamic", readonly=True) + ver_name = fields.Char(string="Version Name") + ver_subject = fields.Char(string="Version Subject", required=True) + ver_editor = fields.Selection([('design', "Design"), ('code', "Code")], string="Version Editor", default="design") + temp_cont = fields.Html(string="Template Content", help="content convert to html code", translate=True, sanitize=False) + temp_id = fields.Char(string="Template ID") + + def create_temp(self): + """ + function is used for creating Mail Template + + """ + api_key = "" + company_id = self.env.company + temp_name = self.temp_name + temp_gen = self.generation + api_info = self.env['ir.config_parameter'].search( + [('key', '=', "SendGrid API Key " + company_id.name + "")]) + if not api_info: + raise UserError(_("It Needs API Key")) + if api_info.company_id.id == self.env.company.id: + api_key = api_info.value + if not api_key and api_key == "": + raise UserError(_("Your Company Needs an API Key")) + conn = http.client.HTTPSConnection("api.sendgrid.com") + + payload = "{\"name\":\""+temp_name+"\",\"generation\":\"dynamic\"}" + + headers = { + 'authorization': "Bearer "+api_key+"", + 'content-type': "application/json" + } + + conn.request("POST", "/v3/templates", payload, headers) + + res = conn.getresponse() + data = res.read() + + temp_data = json.loads(data.decode("utf-8")) + self.temp_id = temp_data['id'] + + def create_ver(self): + """ + Function is used for creating mail content to the + Created Template. + + """ + api_key = "" + if self.temp_cont: + company_id = self.env.company + temp_cont = self.temp_cont + temp_id = self.temp_id + ver_name = self.ver_name + ver_sub = self.ver_subject + api_info = self.env['ir.config_parameter'].search( + [('key', '=', "SendGrid API Key " + company_id.name + "")]) + if not api_info: + raise UserError(_("It Needs API Key")) + if api_info.company_id.id == self.env.company.id: + api_key = api_info.value + if not api_key and api_key == "": + raise UserError(_("Your Company Needs an API Key")) + conn = http.client.HTTPSConnection("api.sendgrid.com") + upt_temp_cnt = (temp_cont.replace('"','')) + + payload = "{\"template_id\":\""+temp_id+"\",\"active\":1,\"name\":\""+ver_name+"\",\"html_content\":\""+upt_temp_cnt+"\",\"plain_content\":\"<%body%>\",\"subject\":\""+ver_sub+"\"}" + + headers = { + 'authorization': "Bearer "+api_key+"", + 'content-type': "application/json" + } + + conn.request("POST", "/v3/templates/"+temp_id+"/versions", payload, headers) + + # res = conn.getresponse() + # data = res.read() + + + + diff --git a/sendgrid_email/models/ir_config_parameter.py b/sendgrid_email/models/ir_config_parameter.py new file mode 100644 index 000000000..2773db273 --- /dev/null +++ b/sendgrid_email/models/ir_config_parameter.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies (). +# Author: Noushid Khan.P () +# +# 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 SendGridAPI(models.Model): + _inherit = "ir.config_parameter" + + company_id = fields.Many2one('res.company', string="Company ID") + + @api.model + def create(self, vals_list): + """ + function is used for auto filling company + details to company_id + + """ + res = super(SendGridAPI, self).create(vals_list) + res.company_id = self.env.company.id + return res + + diff --git a/sendgrid_email/models/mail_mail.py b/sendgrid_email/models/mail_mail.py new file mode 100644 index 000000000..ce8b3752e --- /dev/null +++ b/sendgrid_email/models/mail_mail.py @@ -0,0 +1,549 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies (). +# Author: Noushid Khan.P () +# +# 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 . +# +################################################################################### + +import json + +from odoo import models, fields, api, _ +from odoo.exceptions import UserError +import http.client + + +class SendGridEmail(models.Model): + _inherit = 'mailing.mailing' + + email_temp = fields.Many2one("email.template", string="Email Template") + temp_id = fields.Char(string="Template ID") + from_email = fields.Many2one("email.sent", string="Sender Email") + to_email_partner = fields.Many2many("res.partner", string="Recipient Emails") + to_email_partner_check = fields.Boolean() + to_email_lead = fields.Many2many("crm.lead", string="Recipient Emails") + to_email_lead_check = fields.Boolean() + to_email_contact = fields.Many2many("mailing.contact", string="Recipient Emails") + to_email_contact_check = fields.Boolean() + to_email_applicant = fields.Many2many("hr.applicant", string="Recipient Emails") + to_email_applicant_check = fields.Boolean() + email_finder = fields.Integer(string="Email finder") + sent_count = fields.Integer(string="Send Count") + send_grid_check = fields.Boolean() + temp_check = fields.Boolean() + + def action_send_grid(self): + """ + function used for Sending emails using + SendGrid API using "sendgrid" Button + and creating report based on states. + + """ + company_id = self.env.company + api_key = "" + conn = http.client.HTTPSConnection("api.sendgrid.com") + if not self.temp_id: + raise UserError(_("It Needs A Template ID")) + if self.from_email: + from_email = self.from_email.email_id + from_name = self.from_email.name + else: + from_email = "noreply@johndoe.com" + from_name = "JohnDoe" + if self.to_email_partner: + api_info = self.env['ir.config_parameter'].search( + [('key', '=', "SendGrid API Key " + company_id.name + "")]) + if not api_info: + raise UserError(_("It Needs API Key")) + if api_info.company_id.id == self.env.company.id: + api_key = api_info.value + if not api_key and api_key == "": + raise UserError(_("Your Company Needs an API Key")) + for data in self.to_email_partner: + to_email = data.email + to_name = data.name + to_company = data.company_name + if not to_company: + to_company = "" + temp_id = self.temp_id + if to_email: + payload = "{\"personalizations\":[{\"to\":[{\"email\":\"" + to_email + "\"}],\"dynamic_template_data\":{\"firstname\":\"" + to_name + "\",\"english\":\"true\",\"company\":\"" + to_company + "\"},\"subject\":\"Official Mail\"}],\"from\":{\"email\":\"" + from_email + "\",\"name\":\"" + from_name + "\"},\"template_id\":\"" + temp_id + "\"}" + + headers = { + 'authorization': "Bearer " + api_key + "", + 'content-type': "application/json" + } + + conn.request("POST", "/v3/mail/send", payload, headers) + + res = conn.getresponse() + data_msg = res.read() + error_msg = '' + if data_msg.decode("utf-8"): + error_data = json.loads(data_msg.decode("utf-8")) + error_msg = error_data['errors'][0]['message'] + if not data_msg.decode("utf-8"): + self.sent_count += 1 + self.write({ + 'state': 'done' + }) + self.env['email.api'].create({ + 'name': self.subject, + 'to_email_partner': data.id, + 'to_email': to_email, + 'recipient_name': to_name, + 'company_name': to_company, + 'from_email': self.from_email.id, + 'temp_type': self.email_temp.id, + 'temp_id': self.temp_id, + 'to_email_partner_check': True, + 'email_finder': self.id + }) + + elif error_msg: + self.env['email.api'].create({ + 'name': self.subject, + 'to_email_partner': data.id, + 'to_email': to_email, + 'recipient_name': to_name, + 'company_name': to_company, + 'from_email': self.from_email.id, + 'temp_type': self.email_temp.id, + 'temp_id': self.temp_id, + 'error_msg': error_msg, + 'state': 'error', + 'to_email_partner_check': True, + 'error_check': True, + 'email_finder': self.id + }) + self.email_finder = self.id + self.send_grid_check = True + elif self.to_email_lead: + api_info = self.env['ir.config_parameter'].search( + [('key', '=', "SendGrid API Key " + company_id.name + "")]) + if not api_info: + raise UserError(_("It Needs API Key")) + if api_info.company_id.id == self.env.company.id: + api_key = api_info.value + if not api_key and api_key == "": + raise UserError(_("Your Company Needs an API Key")) + for data in self.to_email_lead: + to_email = data.email_from + to_name = data.contact_name + if not to_name: + raise UserError(_("Your Lead Needs A Contact Name")) + to_company = data.partner_name + if not to_company: + to_company = "" + temp_id = self.temp_id + payload = "" + if to_email: + payload = "{\"personalizations\":[{\"to\":[{\"email\":\"" + to_email + "\"}],\"dynamic_template_data\":{\"firstname\":\"" + to_name + "\",\"english\":\"true\",\"company\":\"" + to_company + "\"},\"subject\":\"Official Mail\"}],\"from\":{\"email\":\"" + from_email + "\",\"name\":\"" + from_name + "\"},\"template_id\":\"" + temp_id + "\"}" + + headers = { + 'authorization': "Bearer " + api_key + "", + 'content-type': "application/json" + } + + conn.request("POST", "/v3/mail/send", payload, headers) + + res = conn.getresponse() + data_msg = res.read() + + error_msg = '' + if data_msg.decode("utf-8"): + error_data = json.loads(data_msg.decode("utf-8")) + error_msg = error_data['errors'][0]['message'] + if not data_msg.decode("utf-8"): + self.sent_count += 1 + self.write({ + 'state': 'done' + }) + self.env['email.api'].create({ + 'name': self.subject, + 'to_email_lead': data.id, + 'to_email': to_email, + 'recipient_name': to_name, + 'company_name': to_company, + 'from_email': self.from_email.id, + 'temp_type': self.email_temp.id, + 'temp_id': self.temp_id, + 'to_email_lead_check': True, + 'email_finder': self.id + }) + + elif error_msg: + self.env['email.api'].create({ + 'name': self.subject, + 'to_email_lead': data.id, + 'to_email': to_email, + 'recipient_name': to_name, + 'company_name': to_company, + 'from_email': self.from_email.id, + 'temp_type': self.email_temp.id, + 'temp_id': self.temp_id, + 'error_msg': error_msg, + 'state': 'error', + 'to_email_lead_check': True, + 'error_check': True, + 'email_finder': self.id + }) + self.email_finder = self.id + self.send_grid_check = True + elif self.to_email_contact: + api_info = self.env['ir.config_parameter'].search( + [('key', '=', "SendGrid API Key " + company_id.name + "")]) + if not api_info: + raise UserError(_("It Needs API Key")) + if api_info.company_id.id == self.env.company.id: + api_key = api_info.value + if not api_key and api_key == "": + raise UserError(_("Your Company Needs an API Key")) + for data in self.to_email_contact: + to_email = data.email + to_name = data.name + to_company = data.company_name + if not to_company: + to_company = "" + temp_id = self.temp_id + payload = "" + if to_email: + payload = "{\"personalizations\":[{\"to\":[{\"email\":\"" + to_email + "\"}],\"dynamic_template_data\":{\"firstname\":\"" + to_name + "\",\"english\":\"true\",\"company\":\"" + to_company + "\"},\"subject\":\"Official Mail\"}],\"from\":{\"email\":\"" + from_email + "\",\"name\":\"" + from_name + "\"},\"template_id\":\"" + temp_id + "\"}" + + headers = { + 'authorization': "Bearer " + api_key + "", + 'content-type': "application/json" + } + + conn.request("POST", "/v3/mail/send", payload, headers) + + res = conn.getresponse() + data_msg = res.read() + + error_msg = '' + if data_msg.decode("utf-8"): + error_data = json.loads(data_msg.decode("utf-8")) + error_msg = error_data['errors'][0]['message'] + if not data_msg.decode("utf-8"): + self.sent_count += 1 + self.write({ + 'state': 'done' + }) + self.env['email.api'].create({ + 'name': self.subject, + 'to_email_contact': data.id, + 'to_email': to_email, + 'recipient_name': to_name, + 'company_name': to_company, + 'from_email': self.from_email.id, + 'temp_type': self.email_temp.id, + 'temp_id': self.temp_id, + 'to_email_contact_check': True, + 'email_finder': self.id + }) + + elif error_msg: + self.env['email.api'].create({ + 'name': self.subject, + 'to_email_contact': data.id, + 'to_email': to_email, + 'recipient_name': to_name, + 'company_name': to_company, + 'from_email': self.from_email.id, + 'temp_type': self.email_temp.id, + 'temp_id': self.temp_id, + 'error_msg': error_msg, + 'state': 'error', + 'to_email_contact_check': True, + 'error_check': True, + 'email_finder': self.id + }) + self.email_finder = self.id + self.send_grid_check = True + elif self.to_email_applicant: + api_info = self.env['ir.config_parameter'].search( + [('key', '=', "SendGrid API Key " + company_id.name + "")]) + if not api_info: + raise UserError(_("It Needs API Key")) + if api_info.company_id.id == self.env.company.id: + api_key = api_info.value + if not api_key and api_key == "": + raise UserError(_("Your Company Needs an API Key")) + for data in self.to_email_applicant: + to_email = data.email_from + to_name = data.partner_name + to_company = data.company_id.name + if not to_company: + to_company = "" + temp_id = self.temp_id + payload = "" + if to_email: + payload = "{\"personalizations\":[{\"to\":[{\"email\":\"" + to_email + "\"}],\"dynamic_template_data\":{\"firstname\":\"" + to_name + "\",\"english\":\"true\",\"company\":\"" + to_company + "\"},\"subject\":\"Official Mail\"}],\"from\":{\"email\":\"" + from_email + "\",\"name\":\"" + from_name + "\"},\"template_id\":\"" + temp_id + "\"}" + + headers = { + 'authorization': "Bearer " + api_key + "", + 'content-type': "application/json" + } + + conn.request("POST", "/v3/mail/send", payload, headers) + + res = conn.getresponse() + data_msg = res.read() + + error_msg = '' + if data_msg.decode("utf-8"): + error_data = json.loads(data_msg.decode("utf-8")) + error_msg = error_data['errors'][0]['message'] + if not data_msg.decode("utf-8"): + self.sent_count += 1 + self.write({ + 'state': 'done' + }) + self.env['email.api'].create({ + 'name': self.subject, + 'to_email_applicant': data.id, + 'to_email': to_email, + 'recipient_name': to_name, + 'company_name': to_company, + 'from_email': self.from_email.id, + 'temp_type': self.email_temp.id, + 'temp_id': self.temp_id, + 'to_email_applicant_check': True, + 'email_finder': self.id + }) + + elif error_msg: + self.env['email.api'].create({ + 'name': self.subject, + 'to_email_applicant': data.id, + 'to_email': to_email, + 'recipient_name': to_name, + 'company_name': to_company, + 'from_email': self.from_email.id, + 'temp_type': self.email_temp.id, + 'temp_id': self.temp_id, + 'error_msg': error_msg, + 'state': 'error', + 'email_finder': self.id, + 'to_email_applicant_check': True, + 'error_check': True + }) + self.email_finder = self.id + self.send_grid_check = True + + @api.onchange('email_temp', 'mailing_model_id', 'contact_list_ids') + def temp_details(self): + """ + function used for filling subject and recipients emails + based on template and recipient emails + + """ + if self.email_temp: + self.temp_check = True + self.subject = self.email_temp.ver_subject + self.temp_id = self.email_temp.temp_id + self.body_html = self.email_temp.temp_cont + self.body_arch = self.email_temp.temp_cont + else: + self.temp_check = False + + if self.mailing_model_real == "sale.order" or self.mailing_model_real == "event.registration" or self.mailing_model_real == "event.track": + self.to_email_contact = False + self.to_email_lead = False + self.to_email_applicant = False + self.mailing_domain = "[]" + for mass_mailing in self: + mai_data = mass_mailing.sudo()._get_recipients() + email_ids = self.env[self.mailing_model_real].search([('id', '=', mai_data)]) + if email_ids: + self.to_email_partner = email_ids.partner_id + elif self.mailing_model_real == "crm.lead": + self.to_email_contact = False + self.to_email_partner = False + self.to_email_applicant = False + self.mailing_domain = "[]" + for mass_mailing in self: + mai_data = mass_mailing.sudo()._get_recipients() + email_ids = self.env[self.mailing_model_real].search([('id', '=', mai_data)]) + if email_ids: + self.to_email_lead = email_ids + elif self.mailing_model_real == "mailing.contact": + self.to_email_partner = False + self.to_email_lead = False + self.to_email_applicant = False + self.mailing_domain = "[]" + for mass_mailing in self: + mai_data = mass_mailing.sudo()._get_recipients() + email_ids = self.env[self.mailing_model_real].search([('id', '=', mai_data)]) + if email_ids: + self.to_email_contact = email_ids + if self.contact_list_ids: + email_ids = self.env[self.mailing_model_real].search( + [('id', '=', mai_data), ('list_ids', '=', self.contact_list_ids.ids)]) + self.to_email_contact = email_ids + + elif self.mailing_model_real == "hr.applicant": + self.to_email_contact = False + self.to_email_lead = False + self.to_email_partner = False + self.mailing_domain = "[]" + for mass_mailing in self: + mai_data = mass_mailing.sudo()._get_recipients() + email_ids = self.env[self.mailing_model_real].search([('id', '=', mai_data)]) + if email_ids: + self.to_email_applicant = email_ids + + else: + self.to_email_contact = False + self.to_email_lead = False + self.to_email_applicant = False + self.mailing_domain = "[]" + for mass_mailing in self: + mai_data = mass_mailing.sudo()._get_recipients() + email_ids = self.env[self.mailing_model_real].search([('id', '=', mai_data)]) + if email_ids: + self.to_email_partner = email_ids + + @api.onchange('mailing_domain') + def get_mails_recipients(self): + """ + function used for filtering based on domain + filter + + """ + if self.mailing_model_real == "sale.order" or self.mailing_model_real == "event.registration" or self.mailing_model_real == "event.track": + for mass_mailing in self: + mai_data = mass_mailing.sudo()._get_recipients() + email_ids = self.env[self.mailing_model_real].search([('id', '=', mai_data)]) + if email_ids: + self.to_email_partner = email_ids.partner_id + elif self.mailing_model_real == "crm.lead": + for mass_mailing in self: + mai_data = mass_mailing.sudo()._get_recipients() + email_ids = self.env[self.mailing_model_real].search([('id', '=', mai_data)]) + if email_ids: + self.to_email_lead = email_ids + elif self.mailing_model_real == "mailing.contact": + for mass_mailing in self: + mai_data = mass_mailing.sudo()._get_recipients() + email_ids = self.env[self.mailing_model_real].search([('id', '=', mai_data)]) + if email_ids: + self.to_email_contact = email_ids + elif self.mailing_model_real == "hr.applicant": + for mass_mailing in self: + mai_data = mass_mailing.sudo()._get_recipients() + email_ids = self.env[self.mailing_model_real].search([('id', '=', mai_data)]) + if email_ids: + self.to_email_applicant = email_ids + else: + for mass_mailing in self: + mai_data = mass_mailing.sudo()._get_recipients() + email_ids = self.env[self.mailing_model_real].search([('id', '=', mai_data)]) + if email_ids: + self.to_email_partner = email_ids + + @api.onchange('to_email_partner', 'to_email_lead', 'to_email_contact', 'to_email_applicant') + def show_hide_fields(self): + """ + function is used for Enabling Needed + recipient mail fields by changing check box + values. + + """ + if self.to_email_partner: + self.to_email_partner_check = True + else: + self.to_email_partner_check = False + if self.to_email_lead: + self.to_email_lead_check = True + else: + self.to_email_lead_check = False + if self.to_email_contact: + self.to_email_contact_check = True + else: + self.to_email_contact_check = False + if self.to_email_applicant: + self.to_email_applicant_check = True + else: + self.to_email_applicant_check = False + + def _action_view_documents_filtered(self, view_filter): + """ + function is used for returning send view in + needed recipient tree view + + """ + if view_filter == 'sent' and self.temp_id: + res_ids = [] + for mass_mailing in self: + mai_data = mass_mailing.sudo()._get_recipients() + res_ids = self.env[self.mailing_model_real].search([('id', '=', mai_data)]) + model_name = self.env['ir.model']._get(self.mailing_model_real).display_name + return { + 'name': model_name, + 'type': 'ir.actions.act_window', + 'view_mode': 'tree', + 'res_model': self.mailing_model_real, + 'domain': [('id', 'in', res_ids.ids)], + 'context': dict(self._context, create=False) + } + else: + return super(SendGridEmail, self)._action_view_documents_filtered(view_filter) + + def _compute_statistics(self): + """ + function is used for computing Send mails Smart button + count + + """ + self.env.cr.execute(""" + SELECT + m.id as mailing_id, + COUNT(s.id) AS expected, + COUNT(CASE WHEN s.sent is not null THEN 1 ELSE null END) AS sent, + COUNT(CASE WHEN s.scheduled is not null AND s.sent is null AND s.exception is null AND s.ignored is null AND s.bounced is null THEN 1 ELSE null END) AS scheduled, + COUNT(CASE WHEN s.scheduled is not null AND s.sent is null AND s.exception is null AND s.ignored is not null THEN 1 ELSE null END) AS ignored, + COUNT(CASE WHEN s.sent is not null AND s.exception is null AND s.bounced is null THEN 1 ELSE null END) AS delivered, + COUNT(CASE WHEN s.opened is not null THEN 1 ELSE null END) AS opened, + COUNT(CASE WHEN s.clicked is not null THEN 1 ELSE null END) AS clicked, + COUNT(CASE WHEN s.replied is not null THEN 1 ELSE null END) AS replied, + COUNT(CASE WHEN s.bounced is not null THEN 1 ELSE null END) AS bounced, + COUNT(CASE WHEN s.exception is not null THEN 1 ELSE null END) AS failed + FROM + mailing_trace s + RIGHT JOIN + mailing_mailing m + ON (m.id = s.mass_mailing_id) + WHERE + m.id IN %s + GROUP BY + m.id + """, (tuple(self.ids),)) + for row in self.env.cr.dictfetchall(): + total = row['expected'] = (row['expected'] - row['ignored']) or 1 + row['received_ratio'] = 100.0 * row['delivered'] / total + row['opened_ratio'] = 100.0 * row['opened'] / total + row['clicks_ratio'] = 100.0 * row['clicked'] / total + row['replied_ratio'] = 100.0 * row['replied'] / total + row['bounced_ratio'] = 100.0 * row['bounced'] / total + self.browse(row.pop('mailing_id')).update(row) + for mail in self: + if mail.temp_id: + mail.sent = mail.sent_count + else: + return super(SendGridEmail, self)._compute_statistics() diff --git a/sendgrid_email/models/model.py b/sendgrid_email/models/model.py new file mode 100644 index 000000000..4c675ce7b --- /dev/null +++ b/sendgrid_email/models/model.py @@ -0,0 +1,137 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies (). +# Author: Noushid Khan.P () +# +# 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 . +# +################################################################################### + +import json + +from odoo import models, fields, _ +import http.client + +from odoo.exceptions import UserError + + +class SendGridSendEmails(models.Model): + _name = "email.api" + _description = "Email Reports" + + name = fields.Char(string="Name") + company_name = fields.Char(string="Company Name") + recipient_name = fields.Char(string="Recipient Name") + to_email = fields.Char(string="Recipient Email ID") + to_email_partner = fields.Many2one("res.partner", string="Recipient Emails") + to_email_partner_check = fields.Boolean() + to_email_lead = fields.Many2one("crm.lead", string="Recipient Emails") + to_email_lead_check = fields.Boolean() + to_email_contact = fields.Many2one("mailing.contact", string="Recipient Emails") + to_email_contact_check = fields.Boolean() + to_email_applicant = fields.Many2one("hr.applicant", string="Recipient Emails") + to_email_applicant_check = fields.Boolean() + from_email = fields.Many2one("email.sent", string="Sender Email") + temp_type = fields.Many2one('email.template', string="Email Template") + temp_id = fields.Char(string="Template_id") + send_date = fields.Datetime(string="Send Date", readonly=True, default=fields.Datetime.now) + error_msg = fields.Text(string="Error Content", readonly=True) + error_check = fields.Boolean() + state = fields.Selection([('send', "Send"), ('error', "Error")], readonly=True, string="State", default='send') + bounce_msg = fields.Text(string="Bounce Message") + email_finder = fields.Integer(string="Email finder") + + def bounce_check(self): + """ + function is used for Checking Email Bounce + Status. + + """ + + conn = http.client.HTTPSConnection("api.sendgrid.com") + + payload = "{}" + + headers = {'authorization': "Bearer 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"} + + conn.request("GET", "/v3/suppression/bounces/" + self.to_email + "", payload, headers) + + res = conn.getresponse() + data = res.read() + + bounce_msg = json.loads(data.decode("utf-8")) + if bounce_msg: + self.bounce_msg = bounce_msg[0]['reason'] + + else: + self.bounce_msg = "This Email Is Not Bounced" + + def send_error_mails(self): + """ + function is used for Resending Error State + mails. + + """ + company_id = self.env.company + api_key = "" + for line in self: + if line.state == 'error': + if not line.temp_id: + raise UserError(_("It Needs A Template ID")) + if line.from_email: + from_email = line.from_email.email_id + else: + from_email = "noreply@johndoe.com" + api_info = self.env['ir.config_parameter'].search( + [('key', '=', "SendGrid API Key " + company_id.name + "")]) + if not api_info: + raise UserError(_("It Needs API Key")) + if api_info.company_id.id == self.env.company.id: + api_key = api_info.value + if not api_key and api_key == "": + raise UserError(_("Your Company Needs an API Key")) + conn = http.client.HTTPSConnection("api.sendgrid.com") + to_company = line.company_name + if not to_company: + to_company = "" + temp_id = line.temp_id + payload = "" + if line.to_email and line.recipient_name: + payload = "{\"personalizations\":[{\"to\":[{\"email\":\"" + line.to_email + "\"}],\"dynamic_template_data\":{\"firstname\":\"" + line.recipient_name + "\",\"english\":\"true\",\"company\":\"" + to_company + "\"},\"subject\":\"Official Mail\"}],\"from\":{\"email\":\"" + from_email + "\",},\"template_id\":\"" + temp_id + "\"}" + headers = { + 'authorization': "Bearer " + api_key + "", + 'content-type': "application/json" + } + + conn.request("POST", "/v3/mail/send", payload, headers) + + res = conn.getresponse() + data_msg = res.read() + + if data_msg.decode("utf-8"): + error_data = json.loads(data_msg.decode("utf-8")) + line.error_msg = error_data['errors'][0]['message'] + if not data_msg.decode("utf-8"): + line.state = 'send' + line.error_msg = "" + line.error_check = False + email_id_use = self.env['mailing.mailing'].search([('id', '=', line.email_finder)]) + email_id_use.send_grid_check = True + email_id_use.sent_count += 1 + email_id_use.write({ + 'state': 'done' + }) diff --git a/sendgrid_email/models/res_config_settings.py b/sendgrid_email/models/res_config_settings.py new file mode 100644 index 000000000..d0d5a3b54 --- /dev/null +++ b/sendgrid_email/models/res_config_settings.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies (). +# Author: Noushid Khan.P () +# +# 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 SendGridApiConfig(models.TransientModel): + _inherit = 'res.config.settings' + + send_grid_api_check = fields.Boolean(string="SendGrid API") + send_grid_api_value = fields.Char(string='API key') + + def set_values(self): + """ save values in the settings fields """ + + super(SendGridApiConfig, self).set_values() + company_id = self.env.company + self.env['ir.config_parameter'].sudo().set_param("SendGrid API Key "+company_id.name+"", + self.send_grid_api_value) diff --git a/sendgrid_email/security/ir.model.access.csv b/sendgrid_email/security/ir.model.access.csv new file mode 100644 index 000000000..98bc69cf3 --- /dev/null +++ b/sendgrid_email/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_email_api,access.email.api,model_email_api,base.group_system,1,1,1,1 +access_email_sent,access.email.sent,model_email_sent,base.group_system,1,1,1,1 +access_email_template,access.email.template,model_email_template,base.group_system,1,1,1,1 \ No newline at end of file diff --git a/sendgrid_email/static/description/banner.png b/sendgrid_email/static/description/banner.png new file mode 100644 index 000000000..bfadfa762 Binary files /dev/null and b/sendgrid_email/static/description/banner.png differ diff --git a/sendgrid_email/static/description/icon.png b/sendgrid_email/static/description/icon.png new file mode 100644 index 000000000..6d7f267c9 Binary files /dev/null and b/sendgrid_email/static/description/icon.png differ diff --git a/sendgrid_email/static/description/images/SendGrid Mail Connectoricon.png b/sendgrid_email/static/description/images/SendGrid Mail Connectoricon.png new file mode 100644 index 000000000..6d7f267c9 Binary files /dev/null and b/sendgrid_email/static/description/images/SendGrid Mail Connectoricon.png differ diff --git a/sendgrid_email/static/description/images/addon-youtube.png b/sendgrid_email/static/description/images/addon-youtube.png new file mode 100644 index 000000000..c2069ce60 Binary files /dev/null and b/sendgrid_email/static/description/images/addon-youtube.png differ diff --git a/sendgrid_email/static/description/images/bounce-status.png b/sendgrid_email/static/description/images/bounce-status.png new file mode 100644 index 000000000..2c4d000cc Binary files /dev/null and b/sendgrid_email/static/description/images/bounce-status.png differ diff --git a/sendgrid_email/static/description/images/checked.png b/sendgrid_email/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/sendgrid_email/static/description/images/checked.png differ diff --git a/sendgrid_email/static/description/images/configuration-check-box.png b/sendgrid_email/static/description/images/configuration-check-box.png new file mode 100644 index 000000000..431455409 Binary files /dev/null and b/sendgrid_email/static/description/images/configuration-check-box.png differ diff --git a/sendgrid_email/static/description/images/configuration-template-menu.png b/sendgrid_email/static/description/images/configuration-template-menu.png new file mode 100644 index 000000000..bdef10c0b Binary files /dev/null and b/sendgrid_email/static/description/images/configuration-template-menu.png differ diff --git a/sendgrid_email/static/description/images/configuration-text-field.png b/sendgrid_email/static/description/images/configuration-text-field.png new file mode 100644 index 000000000..e3436f15d Binary files /dev/null and b/sendgrid_email/static/description/images/configuration-text-field.png differ diff --git a/sendgrid_email/static/description/images/cybrosys.png b/sendgrid_email/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/sendgrid_email/static/description/images/cybrosys.png differ diff --git a/sendgrid_email/static/description/images/display-image.png b/sendgrid_email/static/description/images/display-image.png new file mode 100644 index 000000000..839bb6da1 Binary files /dev/null and b/sendgrid_email/static/description/images/display-image.png differ diff --git a/sendgrid_email/static/description/images/error-resent.png b/sendgrid_email/static/description/images/error-resent.png new file mode 100644 index 000000000..e0572109b Binary files /dev/null and b/sendgrid_email/static/description/images/error-resent.png differ diff --git a/sendgrid_email/static/description/images/error-status.png b/sendgrid_email/static/description/images/error-status.png new file mode 100644 index 000000000..4fc574864 Binary files /dev/null and b/sendgrid_email/static/description/images/error-status.png differ diff --git a/sendgrid_email/static/description/images/from-email-menu.png b/sendgrid_email/static/description/images/from-email-menu.png new file mode 100644 index 000000000..6a96cf3fe Binary files /dev/null and b/sendgrid_email/static/description/images/from-email-menu.png differ diff --git a/sendgrid_email/static/description/images/from-email-page.png b/sendgrid_email/static/description/images/from-email-page.png new file mode 100644 index 000000000..76cfde86f Binary files /dev/null and b/sendgrid_email/static/description/images/from-email-page.png differ diff --git a/sendgrid_email/static/description/images/has_addon.png b/sendgrid_email/static/description/images/has_addon.png new file mode 100644 index 000000000..916fd919e Binary files /dev/null and b/sendgrid_email/static/description/images/has_addon.png differ diff --git a/sendgrid_email/static/description/images/is_addon.png b/sendgrid_email/static/description/images/is_addon.png new file mode 100644 index 000000000..abf6e7dfc Binary files /dev/null and b/sendgrid_email/static/description/images/is_addon.png differ diff --git a/sendgrid_email/static/description/images/mail-test.png b/sendgrid_email/static/description/images/mail-test.png new file mode 100644 index 000000000..fc2193da5 Binary files /dev/null and b/sendgrid_email/static/description/images/mail-test.png differ diff --git a/sendgrid_email/static/description/images/mailing-confirm.png b/sendgrid_email/static/description/images/mailing-confirm.png new file mode 100644 index 000000000..0fa37162e Binary files /dev/null and b/sendgrid_email/static/description/images/mailing-confirm.png differ diff --git a/sendgrid_email/static/description/images/mailing-mail-body.png b/sendgrid_email/static/description/images/mailing-mail-body.png new file mode 100644 index 000000000..7806dc917 Binary files /dev/null and b/sendgrid_email/static/description/images/mailing-mail-body.png differ diff --git a/sendgrid_email/static/description/images/mailing-page-form.png b/sendgrid_email/static/description/images/mailing-page-form.png new file mode 100644 index 000000000..59b15bc77 Binary files /dev/null and b/sendgrid_email/static/description/images/mailing-page-form.png differ diff --git a/sendgrid_email/static/description/images/mailing-page-kanban.png b/sendgrid_email/static/description/images/mailing-page-kanban.png new file mode 100644 index 000000000..84f37500c Binary files /dev/null and b/sendgrid_email/static/description/images/mailing-page-kanban.png differ diff --git a/sendgrid_email/static/description/images/mailing-report-tree.png b/sendgrid_email/static/description/images/mailing-report-tree.png new file mode 100644 index 000000000..769f6f23e Binary files /dev/null and b/sendgrid_email/static/description/images/mailing-report-tree.png differ diff --git a/sendgrid_email/static/description/images/mailing-report.png b/sendgrid_email/static/description/images/mailing-report.png new file mode 100644 index 000000000..56691749b Binary files /dev/null and b/sendgrid_email/static/description/images/mailing-report.png differ diff --git a/sendgrid_email/static/description/images/mailing-send-grid.png b/sendgrid_email/static/description/images/mailing-send-grid.png new file mode 100644 index 000000000..3375f6643 Binary files /dev/null and b/sendgrid_email/static/description/images/mailing-send-grid.png differ diff --git a/sendgrid_email/static/description/images/mailing-state-send.png b/sendgrid_email/static/description/images/mailing-state-send.png new file mode 100644 index 000000000..a90b8878b Binary files /dev/null and b/sendgrid_email/static/description/images/mailing-state-send.png differ diff --git a/sendgrid_email/static/description/images/mailing-to-email.png b/sendgrid_email/static/description/images/mailing-to-email.png new file mode 100644 index 000000000..cb788ac27 Binary files /dev/null and b/sendgrid_email/static/description/images/mailing-to-email.png differ diff --git a/sendgrid_email/static/description/images/module_add_multi.png b/sendgrid_email/static/description/images/module_add_multi.png new file mode 100644 index 000000000..322f18f64 Binary files /dev/null and b/sendgrid_email/static/description/images/module_add_multi.png differ diff --git a/sendgrid_email/static/description/images/module_auto_mail.png b/sendgrid_email/static/description/images/module_auto_mail.png new file mode 100644 index 000000000..4a5f5d945 Binary files /dev/null and b/sendgrid_email/static/description/images/module_auto_mail.png differ diff --git a/sendgrid_email/static/description/images/module_gantt_view.png b/sendgrid_email/static/description/images/module_gantt_view.png new file mode 100644 index 000000000..edc204b88 Binary files /dev/null and b/sendgrid_email/static/description/images/module_gantt_view.png differ diff --git a/sendgrid_email/static/description/images/module_report.png b/sendgrid_email/static/description/images/module_report.png new file mode 100644 index 000000000..b025b5c48 Binary files /dev/null and b/sendgrid_email/static/description/images/module_report.png differ diff --git a/sendgrid_email/static/description/images/module_report_account.png b/sendgrid_email/static/description/images/module_report_account.png new file mode 100644 index 000000000..60b9433b3 Binary files /dev/null and b/sendgrid_email/static/description/images/module_report_account.png differ diff --git a/sendgrid_email/static/description/images/module_sms.png b/sendgrid_email/static/description/images/module_sms.png new file mode 100644 index 000000000..6333691e4 Binary files /dev/null and b/sendgrid_email/static/description/images/module_sms.png differ diff --git a/sendgrid_email/static/description/images/report-page-form.png b/sendgrid_email/static/description/images/report-page-form.png new file mode 100644 index 000000000..05502059c Binary files /dev/null and b/sendgrid_email/static/description/images/report-page-form.png differ diff --git a/sendgrid_email/static/description/images/smart-button-send.png b/sendgrid_email/static/description/images/smart-button-send.png new file mode 100644 index 000000000..0584e833c Binary files /dev/null and b/sendgrid_email/static/description/images/smart-button-send.png differ diff --git a/sendgrid_email/static/description/images/template-create-template.png b/sendgrid_email/static/description/images/template-create-template.png new file mode 100644 index 000000000..ea4f2442c Binary files /dev/null and b/sendgrid_email/static/description/images/template-create-template.png differ diff --git a/sendgrid_email/static/description/images/template-create-version.png b/sendgrid_email/static/description/images/template-create-version.png new file mode 100644 index 000000000..b5792eb16 Binary files /dev/null and b/sendgrid_email/static/description/images/template-create-version.png differ diff --git a/sendgrid_email/static/description/images/template-from-filled.png b/sendgrid_email/static/description/images/template-from-filled.png new file mode 100644 index 000000000..1d37f83f9 Binary files /dev/null and b/sendgrid_email/static/description/images/template-from-filled.png differ diff --git a/sendgrid_email/static/description/images/template-page-form.png b/sendgrid_email/static/description/images/template-page-form.png new file mode 100644 index 000000000..12a315633 Binary files /dev/null and b/sendgrid_email/static/description/images/template-page-form.png differ diff --git a/sendgrid_email/static/description/images/template-page-tree.png b/sendgrid_email/static/description/images/template-page-tree.png new file mode 100644 index 000000000..457ad726f Binary files /dev/null and b/sendgrid_email/static/description/images/template-page-tree.png differ diff --git a/sendgrid_email/static/description/index.html b/sendgrid_email/static/description/index.html new file mode 100644 index 000000000..91d3a89c8 --- /dev/null +++ b/sendgrid_email/static/description/index.html @@ -0,0 +1,1634 @@ +
+
+ +
+
+
+

Mass Mailing With SendGrid

+

+Mass Mailing using SendGrid API +

+
+

Key Highlights

+
    + +
  • +Mass Mailing option using SendGrid API +
  • + +
  • +SendGrid Send Emails submenu in Email Marketing Reporting menu can be use +for viewing Mail Details. +
  • + + +
  • +In SendGrid Send Emails Will Show the Error Emails and cause of Error in The Record. +It also include Mail Bounce Check +
  • + +
  • +Bounce Check Button Will show cause of the bounce Email in the page view. +
  • + +
  • +Resend Error Emails Button in the action menu can be use for resend the selected +error emails. +
  • + +
+ +
+
+
+
+ + +
+
+
+ + + +
+
+ +

Overview

+
+

+The module will help send emails through SendGrid Mailing Service. It could be use full for +Bulk Mailing. The email templates can create by the user. It work with the API key provided +by the user. +

+ +
+ +
+ +

SendGrid Email Service

+
+
    + +
  • +check +You need to get a SendGrid API key To use This module +
  • +
+
+ + +
+ +

SendGrid Email

+
+
    + +
  • check +It work with using the API Key. It can be set in the configuration. + +
  • + +
  • check +SendGrid Template Details submenu in Email Marketing configuration using to create +email templates. +
  • + +
  • check +SendGrid From Emails submenu in Email Marketing Configuration using for storing +From Emails. + +
  • + +
  • check +In Email Marketing Mailing Form contains a page named SendGrid Email.There we can select +the Sending Template. +
  • + + +
  • check +We could Use Recipients field to sort the recipient emails. +
  • + + +
  • check +Mail can be send by using SendGrid Button in Mailing Form. +
  • + + +
  • check +SendGrid Send Emails submenu in Email Marketing Reporting menu can be use +for viewing Mail Details. +
  • + + +
  • check +In SendGrid Send Emails Will Show the Error Emails and cause of Error in The Record. +It also include Mail Bounce Check +
  • + +
  • check +Bounce Check Button Will show cause of the bounce Email in the page view. +
  • + +
  • check +Resend Error Emails Button in the action menu can be use for resend the selected +error emails. +
  • + + +
+
+
+
+
+
+ + + +
+ +
+

Screenshots

+
+
+
+ +
+ +
+

Suggested Products

+
+ +
+ + +
+

Our Service

+
+ +
+
+
+

Our Industries

+
+ +
+
+
+
+ Odoo Industry
+
+
+

+ + Trading

+

+ Easily procure and sell your products.

+
+
+
+
+
+ Odoo Industry +
+
+
+

+ + Manufacturing

+

+ Plan, track and schedule your operations.

+
+
+
+
+
+ + Odoo Industry
+
+
+

+ + Restaurant

+

+ Run your bar or restaurant methodical.

+
+
+
+
+
+ Odoo Industry
+
+
+

+ + POS

+

+ Easy configuring and convivial selling.

+
+
+
+
+
+ Odoo Industry
+
+
+

+ + E-commerce & Website

+

+ Mobile friendly, awe-inspiring product pages.

+
+
+
+
+
+ + Odoo Industry
+
+
+

+ + Hotel Management

+

+ An all-inclusive hotel management application.

+
+
+
+
+
+ + Odoo Industry
+
+
+

+ + Education

+

+ A Collaborative platform for educational management.

+
+
+
+
+
+ Odoo Industry
+
+
+

+ + Service Management

+

+ Keep track of services and invoice accordingly.

+
+
+
+
+
+ + + +
+
+
+

Need Any Help?

+
+ +

If you have anything to share with us based on your use of this module, please + let us know. We are ready to offer our support.

+
+

Email us

+

odoo@cybrosys.com / info@cybrosys.com

+ +
+
+

Contact Us

+ www.cybrosys.com +
+
+ +
+
+ + +
+
+
+ + +
+
+ +
+ + + + + + + + +
+
+
+
+ diff --git a/sendgrid_email/views/ir_config_view.xml b/sendgrid_email/views/ir_config_view.xml new file mode 100644 index 000000000..084ace881 --- /dev/null +++ b/sendgrid_email/views/ir_config_view.xml @@ -0,0 +1,18 @@ + + + + + + company config + ir.config_parameter + + + + + + + + + + \ No newline at end of file diff --git a/sendgrid_email/views/mail_view.xml b/sendgrid_email/views/mail_view.xml new file mode 100644 index 000000000..0ea905f6e --- /dev/null +++ b/sendgrid_email/views/mail_view.xml @@ -0,0 +1,99 @@ + + + + + + SendGrid Mass MAil + mailing.mailing + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sendgrid_email/views/res_config_view.xml b/sendgrid_email/views/res_config_view.xml new file mode 100644 index 000000000..b526b3e55 --- /dev/null +++ b/sendgrid_email/views/res_config_view.xml @@ -0,0 +1,37 @@ + + + + + res.config.settings.view.form.inherit.send.grid + res.config.settings + + + + +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/sendgrid_email/views/view.xml b/sendgrid_email/views/view.xml new file mode 100644 index 000000000..614d6a341 --- /dev/null +++ b/sendgrid_email/views/view.xml @@ -0,0 +1,218 @@ + + + + + + Send Emails + email.api + tree,form + {'group_by': 'name'} + +

Create contacts +

+
+
+ + + Send Emails tree + email.api + + + + + + + + + + + + Send Emails Form + email.api + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +