From db7ea5fe8af8164a4ebdd3c2d3419958e3d3b84e Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 25 Sep 2015 18:14:21 +0200 Subject: [PATCH] Add beautier pages for unsubscription process. --- mass_mailing_custom_unsubscribe/README.rst | 40 ++++++------ mass_mailing_custom_unsubscribe/__init__.py | 2 +- .../__manifest__.py | 6 +- .../controllers.py | 15 +++++ .../views/pages.xml | 61 +++++++++++++++++++ 5 files changed, 104 insertions(+), 20 deletions(-) create mode 100644 mass_mailing_custom_unsubscribe/controllers.py create mode 100644 mass_mailing_custom_unsubscribe/views/pages.xml diff --git a/mass_mailing_custom_unsubscribe/README.rst b/mass_mailing_custom_unsubscribe/README.rst index 784b2706..293670cc 100644 --- a/mass_mailing_custom_unsubscribe/README.rst +++ b/mass_mailing_custom_unsubscribe/README.rst @@ -1,33 +1,38 @@ .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg :alt: License: AGPL-3 -==================================================== -Customizable unsubscribe link on mass mailing emails -==================================================== +========================================================== +Customizable unsubscription process on mass mailing emails +========================================================== -With this module you can set a custom unsubscribe link append at bottom of mass -mailing emails. +With this module you can set a custom unsubscribe link appended at the bottom +of mass mailing emails. Configuration ============= -To configure unsubscribe label go to Setting > Technical > Parameters > System parameters -and add a 'mass_mailing.unsubscribe.label' parameter with html to set at bottom -of mass emailing emails. Including '%(url)s' variable where unsubscribe link +To configure unsubscribe label go to *Settings > Technical > Parameters > +System parameters* and add a ``mass_mailing.unsubscribe.label`` parameter +with HTML to set at the bottom of mass emailing emails. Including ``%(url)s`` +variable where unsubscribe link. -For example: +For example:: -.. code:: html + You can unsubscribe here - You can unsubscribe here +Additionally, you can disable this link if you set this parameter to ``False``. +If this parameter (``mass_mailing.unsubscribe.label``) does not exist, the +default 'Click to unsubscribe' link will appear, with the advantage that it is +translatable via *Settings > Translations > Application Terms > Translated +terms*. -Additionally, you can disable this link if you set this parameter to 'False' +Also your unsubscriptors will recieve a beautier goodbye page. You can +customize it clicking here **after installing the module**: -If this parameter (mass_mailing.unsubscribe.label) is not set (or set to '') -default 'Click to unsubscribe' link will appear. This default text is -translatable via Settings > Translations > Application Terms > Translated terms +* `Unsubscription successful `_. +* `Unsubscription failed `_. Usage @@ -41,7 +46,7 @@ Usage Known issues / Roadmap ====================== -* This custom html is not translatable, so as a suggestion, you can define +* This custom HTML is not translatable, so as a suggestion, you can define the same text in several languages in several lines. For example: @@ -69,6 +74,7 @@ Contributors * Rafael Blasco * Antonio Espinosa +* Jairo Llopis Maintainer ---------- @@ -83,4 +89,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit http://odoo-community.org. \ No newline at end of file +To contribute to this module, please visit http://odoo-community.org. diff --git a/mass_mailing_custom_unsubscribe/__init__.py b/mass_mailing_custom_unsubscribe/__init__.py index 8764d62c..17b13c3f 100644 --- a/mass_mailing_custom_unsubscribe/__init__.py +++ b/mass_mailing_custom_unsubscribe/__init__.py @@ -4,4 +4,4 @@ # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## -from . import models +from . import controllers, models diff --git a/mass_mailing_custom_unsubscribe/__manifest__.py b/mass_mailing_custom_unsubscribe/__manifest__.py index 5429b38b..5d749a3e 100644 --- a/mass_mailing_custom_unsubscribe/__manifest__.py +++ b/mass_mailing_custom_unsubscribe/__manifest__.py @@ -21,13 +21,15 @@ # ############################################################################## { - 'name': "Customizable unsubscribe link on mass mailing emails", + 'name': "Customizable unsubscription process on mass mailing emails", 'category': 'Marketing', - 'version': '8.0.1.0.0', + 'version': '8.0.1.1.0', 'depends': [ 'mass_mailing', + 'website_crm', ], 'data': [ + 'views/pages.xml', ], 'author': 'Antiun Ingeniería S.L., ' 'Odoo Community Association (OCA)', diff --git a/mass_mailing_custom_unsubscribe/controllers.py b/mass_mailing_custom_unsubscribe/controllers.py new file mode 100644 index 00000000..b05ceee5 --- /dev/null +++ b/mass_mailing_custom_unsubscribe/controllers.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# © 2015 Antiun Ingeniería S.L. (http://www.antiun.com) +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). + +from openerp import http +from openerp.addons.mass_mailing.controllers.main import MassMailController + + +class CustomUnsuscribe(MassMailController): + @http.route() + def mailing(self, *args, **kwargs): + path = "/page/mass_mail_unsubscription_%s" + result = super(CustomUnsuscribe, self).mailing(*args, **kwargs) + return http.local_redirect( + path % ("success" if result.data == "OK" else "failure")) diff --git a/mass_mailing_custom_unsubscribe/views/pages.xml b/mass_mailing_custom_unsubscribe/views/pages.xml new file mode 100644 index 00000000..b4ed5cf5 --- /dev/null +++ b/mass_mailing_custom_unsubscribe/views/pages.xml @@ -0,0 +1,61 @@ + + + + + + + + + +