Add beautier pages for unsubscription process.

This commit is contained in:
Jairo Llopis 2015-09-25 18:14:21 +02:00 committed by Ernesto Tejeda
parent ca01a85a12
commit 1b72b82749
5 changed files with 104 additions and 20 deletions

View File

@ -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
<small>You can unsubscribe <a href="%(url)s">here</a></small>
<small>You can unsubscribe <a href="%(url)s">here</a></small>
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 </page/mass_mail_unsubscription_success>`_.
* `Unsubscription failed </page/mass_mail_unsubscription_failure>`_.
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 <rafabn@antiun.com>
* Antonio Espinosa <antonioea@antiun.com>
* Jairo Llopis <yajo.sk8@gmail.com>
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.
To contribute to this module, please visit http://odoo-community.org.

View File

@ -4,4 +4,4 @@
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from . import models
from . import controllers, models

View File

@ -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)',

View File

@ -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"))

View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8" ?>
<openerp>
<data>
<template name="Unsubscription worked"
id="website.mass_mail_unsubscription_success"
page="True">
<t t-call="website.layout">
<div id="wrap" class="oe_structure oe_empty">
<section class="jumbotron mt16 mb16">
<div class="container">
<h1>
You were successfully unsubscribed from our
mailing list.
</h1>
<h3 class="text-muted">
It's sad to see you go, but if you love
something, let it go.
</h3>
<p>
However, we are open to suggestions. Please tell us
why you left.
</p>
<p>
<a class="btn btn-primary btn-lg"
href="/page/website.contactus">Contact us</a>
</p>
</div>
</section>
</div>
</t>
</template>
<template name="Unsubscription failed"
id="website.mass_mail_unsubscription_failure"
page="True">
<t t-call="website.layout">
<div id="wrap" class="oe_structure oe_empty">
<section class="jumbotron mt16 mb16">
<div class="container">
<h1>
There was an error processing your unsubscription
request.
</h1>
<p>
We apologize for the inconvenience. You can contact us
and we will handle your unsubscription manually.
</p>
<p>Thanks for your patience.</p>
<p>
<a class="btn btn-primary btn-lg"
href="/page/website.contactus">Contact us</a>
</p>
</div>
</section>
</div>
</t>
</template>
</data>
</openerp>