From 7b4e303658caa7253a4005252ce82bd0922efcb4 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 | 34 ++++++----- mass_mailing_custom_unsubscribe/__init__.py | 2 +- .../__openerp__.py | 6 +- .../controllers.py | 15 +++++ .../views/pages.xml | 61 +++++++++++++++++++ 5 files changed, 101 insertions(+), 17 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..d2294e44 100644 --- a/mass_mailing_custom_unsubscribe/README.rst +++ b/mass_mailing_custom_unsubscribe/README.rst @@ -1,9 +1,9 @@ .. 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. @@ -12,22 +12,27 @@ 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 *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. -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``) 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*. -Additionally, you can disable this link if you set this parameter to 'False' +Also your unsubscriptors will recieve a beautier good bye 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 @@ -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/__openerp__.py b/mass_mailing_custom_unsubscribe/__openerp__.py index 5429b38b..65d727f7 100644 --- a/mass_mailing_custom_unsubscribe/__openerp__.py +++ b/mass_mailing_custom_unsubscribe/__openerp__.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.2.0.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..566f6f69 --- /dev/null +++ b/mass_mailing_custom_unsubscribe/views/pages.xml @@ -0,0 +1,61 @@ + + + + + + + + + +