From 7f25a7f7246415980c0137e3e67afd21042e0f0c Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 25 Sep 2015 18:14:21 +0200 Subject: [PATCH 1/2] 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 bb6854e8..955851af 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 @@ + + + + + + + + + + From 2fec5080fea0408ab93b16f4693fb4a7abaf6021 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 14 Oct 2015 16:54:15 +0200 Subject: [PATCH 2/2] Fix typos and aesthetic failures. --- mass_mailing_custom_unsubscribe/README.rst | 20 +++++++++---------- .../__openerp__.py | 2 +- .../views/pages.xml | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/mass_mailing_custom_unsubscribe/README.rst b/mass_mailing_custom_unsubscribe/README.rst index d2294e44..293670cc 100644 --- a/mass_mailing_custom_unsubscribe/README.rst +++ b/mass_mailing_custom_unsubscribe/README.rst @@ -5,17 +5,17 @@ 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:: @@ -23,12 +23,12 @@ For example:: 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 +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*. -Also your unsubscriptors will recieve a beautier good bye page. You can +Also your unsubscriptors will recieve a beautier goodbye page. You can customize it clicking here **after installing the module**: * `Unsubscription successful `_. @@ -46,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: diff --git a/mass_mailing_custom_unsubscribe/__openerp__.py b/mass_mailing_custom_unsubscribe/__openerp__.py index 955851af..c632f52d 100644 --- a/mass_mailing_custom_unsubscribe/__openerp__.py +++ b/mass_mailing_custom_unsubscribe/__openerp__.py @@ -23,7 +23,7 @@ { 'name': "Customizable unsubscription process on mass mailing emails", 'category': 'Marketing', - 'version': '8.0.2.0.0', + 'version': '8.0.1.1.0', 'depends': [ 'mass_mailing', 'website_crm', diff --git a/mass_mailing_custom_unsubscribe/views/pages.xml b/mass_mailing_custom_unsubscribe/views/pages.xml index 566f6f69..b4ed5cf5 100644 --- a/mass_mailing_custom_unsubscribe/views/pages.xml +++ b/mass_mailing_custom_unsubscribe/views/pages.xml @@ -11,7 +11,7 @@

You were successfully unsubscribed from our - mailing list + mailing list.

It's sad to see you go, but if you love @@ -40,10 +40,10 @@

There was an error processing your unsubscription - request + request.

- We apologize for the inconvinience. You can contact us + We apologize for the inconvenience. You can contact us and we will handle your unsubscription manually.

Thanks for your patience.